Compare commits

...

248 Commits
v4.13 ... v4.14

Author SHA1 Message Date
e1fec334db Prepare for 4.14 release
* NEWS: Update for 4.14 release.
2016-10-04 18:19:20 +00:00
c1a0b67db5 Generate SEN numbers in a locale independent order
* generate_sen.sh: Sort SEN numbers using C collation rules.
2016-10-04 08:19:27 +00:00
7082acc0e3 Assume that offsetof is provided by stddef.h
According to C89, <stddef.h> shall define offsetof macro.

* defs.h: Include <stddef.h> unconditionally.
[!offsetof]: Remove.
2016-10-04 00:16:44 +00:00
7bce0e9fd4 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 23:50:57 +00:00
27aaa29d73 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 23:48:48 +00:00
66db159f7e 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 21:50:45 +00:00
9f294b39f5 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 21:50:45 +00:00
ee70a1baac 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 21:50:33 +00:00
5cf68f97d5 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 19:28:15 +00:00
04ec08ab62 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 19:27:38 +00:00
820adffcd9 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.
2016-10-03 15:51:49 +00:00
7b6d66f215 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.
2016-10-03 12:13:19 +00:00
4503da0816 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 12:03:03 +00:00
7211bdb982 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.
2016-10-03 12:03:03 +00:00
6fdb10455a Add function for getting errno string
* defs.h (err_name): New prototype.
* syscall.c (err_name): New function.
2016-10-03 11:54:49 +00:00
ba63d8a166 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-03 11:48:55 +00:00
cce5aaef1e 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 19:19:28 +00:00
7fa26e1712 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 19:19:15 +00:00
f5278a7d94 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 19:19:15 +00:00
db098f9a3d 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 19:19:15 +00:00
f3228d3268 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-02 19:19:15 +00:00
e8f36ec0c5 tests: fix typo in qual_syscall.test
Fix test regression introduced by commit v4.13-225-g55334ef.

* tests/qual_syscall.test: Fix typo.
2016-10-01 14:27:00 +00:00
a606d3a74a 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 13:43:48 +00:00
55334effed tests/qual_syscall.test: rewrite without ls
* tests/qual_syscall.test: Invoke ./umovestr instead of ls.
Update expected output.
2016-09-30 13:09:36 +00:00
a2402cea20 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 03:00:10 +00:00
54a4a1a918 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 03:00:10 +00:00
1929c2216a 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 03:00:10 +00:00
2c871eb566 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 03:00:10 +00:00
b93991d381 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 03:00:10 +00:00
11f7093560 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 03:00:10 +00:00
cfa1b17619 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 03:00:10 +00:00
dbb76606dc 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-28 03:00:07 +00:00
5af0e0dab8 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 18:02:07 +00:00
e32f7eeefc 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 18:01:36 +00:00
ec3761429e 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.
2016-09-27 18:01:09 +00:00
aefb09b9cc 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.
2016-09-27 17:55:35 +00:00
db27247d84 tests: additional getcwd decoding checks
* tests/getcwd.c (main): Add more checks for getcwd arguments decoding.
2016-09-27 17:53:50 +00:00
81b63834dd 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 08:11:06 +00:00
ee9e7a7e5b 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.
2016-09-27 01:08:38 +00:00
906dc4aaa1 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.
2016-09-27 00:57:28 +00:00
340909fd00 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 00:57:28 +00:00
fd5195dccd 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 00:57:28 +00:00
abde34546d 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 00:57:27 +00:00
46b89571f5 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 00:57:27 +00:00
4cb1124902 quota: Add decoding for Q_XQUOTARM subcommand
* quota.c (decode_cmd_data): Add Q_XQUOTARM handling to subcommand
  switch.
2016-09-27 00:57:27 +00:00
01bb1d206a 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 00:57:27 +00:00
3b3fd71546 quota: add missing prefixes to struct field names
* quota.c (decode_cmd_data): Print field names in accordance with
their definition.
2016-09-27 00:57:27 +00:00
f8b50ef4ea quota: fix indentation inside subcommand dispatching switch statement 2016-09-27 00:57:20 +00:00
51330fd434 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 00:57:20 +00:00
e87379b820 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.
2016-09-27 00:57:20 +00:00
0cda3e0823 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-27 00:57:14 +00:00
632cc8a697 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.
2016-09-26 15:24:27 +00:00
5cc7036061 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.
2016-09-26 15:24:26 +00:00
074c630705 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.
2016-09-26 15:24:25 +00:00
0c5b09c658 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.
2016-09-26 15:24:23 +00:00
a392aaa796 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.
2016-09-26 15:24:22 +00:00
aa95ec7648 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.
2016-09-26 15:24:01 +00:00
0400e2ca7d 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.
2016-09-26 15:23:48 +00:00
68beed808a 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 15:23:25 +00:00
91eb1eddb0 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-26 15:23:18 +00:00
212a444bdc 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 20:55:56 +00:00
0918a4c3a2 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.
2016-09-20 15:17:37 +00:00
b9bac78553 tests: use sprintrc in tests/netlink_protocol.c
* tests/netlink_protocol.c (main): Use sprintrc.
2016-09-20 12:29:35 +00:00
99f41c592d tests: use sprintrc in tests/fchownat.c
* tests/fchownat.c (main): Use sprintrc.
2016-09-20 00:48:57 +00:00
48ba1de869 tests: use sprintrc in tests/fchmodat.c
* tests/fchmodat.c (main): Use sprintrc.  Add more fchmodat decoding tests.
2016-09-20 00:23:10 +00:00
e9bfa4e406 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.
2016-09-20 00:23:10 +00:00
ac563cff02 tests: use sprintrc in tests/getgroups.c
* tests/getgroups.c (main): Use sprintrc.
2016-09-20 00:23:10 +00:00
fe1a225459 tests: use sprintrc in tests/setgroups.c
* tests/setgroups.c (main): Use sprintrc.
2016-09-20 00:23:05 +00:00
24f6345505 tests/utime.c: rewrite without assert
* tests/utime.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-19 19:51:37 +00:00
c7cd262a06 tests/xattr.c: rewrite without assert
* tests/xattr.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-19 19:51:37 +00:00
1caf9f296b tests: use sprintrc in tests/xchownx.c
* tests/xchownx.c (main): Do not include <errno.h>.  Use sprintrc.
2016-09-19 19:51:37 +00:00
8870b9e831 tests/xstatfsx.c: fix potential errno clobbering
* tests/xstatfsx.c (main): Use sprintrc.
2016-09-19 19:51:37 +00:00
38ce2658cd 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-19 19:51:30 +00:00
43e85a6648 tests: fix whitespace for explicit type casts in futex test 2016-09-15 20:05:44 +00:00
eb5b530be3 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 23:52:36 +00:00
6cb1ced84f 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-14 23:41:19 +00:00
1ae660572f 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 21:18:17 +00:00
1bc727fc2f 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-13 17:21:20 +00:00
ecc9fc1e49 .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 23:38:20 +00:00
61bf3050f3 .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 23:33:46 +00:00
7f6f692916 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 15:34:27 +00:00
07eb711ec6 x32: update ioctl entries from linux 4.8
* linux/x32/ioctls_inc0.h: Update from linux v4.8 using ioctls_gen.sh.
2016-09-12 13:55:59 +00:00
7e8314eb34 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 13:55:59 +00:00
378a47e80a tests: use sprintrc_grep in tests/ipc_shm.c
* tests/ipc_shm.c (main): Use sprintrc_grep.
2016-09-12 10:30:22 +00:00
3138893026 tests: use sprintrc_grep in tests/ipc_sem.c
* tests/ipc_sem.c (main): Use sprintrc_grep.
2016-09-12 09:27:58 +00:00
adffd04424 tests: use sprintrc_grep in tests/ipc_msg.c
* tests/ipc_msg.c (main): Use sprintrc_grep.
2016-09-11 00:04:16 +00:00
961a541ab4 tests: use sprintrc in tests/chmod.c
* tests/chmod.c (main): Use sprintrc.  Add more chmod decoding tests.
2016-09-10 22:58:40 +00:00
06847fe282 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 22:18:11 +00:00
84de545d73 tests/aio.c: bring indentation in conformance with the rest of the file 2016-09-09 22:18:11 +00:00
083123860b 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 22:18:11 +00:00
a92ba46c55 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-09 02:38:32 +00:00
f6c70f9f19 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 22:56:25 +00:00
3351924396 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 20:04:20 +00:00
047c42e7c8 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 16:40:50 +00:00
7b93574bc7 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 16:26:48 +00:00
f4b7ac23b9 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 12:33:44 +00:00
0797de9efe 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 12:33:44 +00:00
6d995ae68b 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 01:37:18 +00:00
ee7d47f4d6 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 01:37:14 +00:00
e3ed9f557c tests: split long lines in sched_xetattr test
* tests/sched_xetattr.c (main): Split long lines.
2016-09-08 01:34:12 +00:00
9b95549a25 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 13:17:59 +00:00
ed292f62d6 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 13:01:29 +00:00
460c6253c4 tests/aio.c: rewrite without assert
* tests/aio.c: Do not include <assert.h>.
(main): Use sprintrc instead of assert.
2016-09-07 01:44:50 +00:00
851ac444f4 tests: add more aio decoding checks
* tests/aio.c (sprint_aio_context_t): New function.
(main): Use it; add more checks.
2016-09-06 16:07:14 +00:00
ea7adc3c4f 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-06 09:06:24 +00:00
06d0a0eaa3 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.
2016-09-05 19:58:00 +00:00
af0d956078 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 19:52:57 +00:00
b5d7a0b7cf tests: use sprintrc in tests/xetpriority.c
* tests/xetpriority.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
b177783770 tests: use sprintrc in vhangup.test
* tests/vhangup.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
60d5765b5a tests: use sprintrc in tests/sockname.c
* tests/sockname.c (test_sockname_syscall): Use sprintrc.
2016-09-05 15:58:35 +00:00
e0a886d378 tests: use sprintrc in signalfd4.test
* tests/signalfd4.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
a46700d697 tests: use sprintrc in setrlimit.test
* tests/setrlimit.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
746d6eb2e2 tests: use sprintrc in set_mempolicy.test
* tests/set_mempolicy.c (main, print_nodes): Use sprintrc.
2016-09-05 15:58:35 +00:00
416896888d tests: use sprintrc in openat.test
* tests/openat.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
f7352b73a2 tests: use sprintrc in open.test
* tests/open.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
1b03fa4ab8 tests: use sprintrc in move_pages.test
* tests/move_pages.c (print_stat_pages, print_move_pages): Use sprintrc.
2016-09-05 15:58:35 +00:00
79582ae9af tests: use sprintrc in mlockall.test
* tests/mlockall.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
ef62ce49a1 tests: use sprintrc in mlock.test
* tests/mlock.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
1b36107cc2 tests: use sprintrc in epoll_create1.test
* tests/epoll_create1.c (main): Use sprintrc.
2016-09-05 15:58:35 +00:00
df00cad32e 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.
2016-09-05 15:58:35 +00:00
afcbaaf050 tests: use sprintrc for return code output in aio test
* tests/aio.c (main): Use sprintrc for return code output.
2016-09-05 15:58:35 +00:00
25463ec93e 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.
2016-09-05 15:58:35 +00:00
2fdb64efd6 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.
2016-09-05 15:58:35 +00:00
7890a1e208 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.
2016-09-05 15:58:35 +00:00
88d0a427ed 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 15:58:35 +00:00
2b962b26a0 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 15:08:40 +00:00
724c623596 sh64: wire up new syscalls
* linux/sh64/syscallent.h [380..393]: New entries.
2016-09-05 13:05:38 +00:00
596c63dead sh: wire up new syscalls
* linux/sh/syscallent.h [369..382]: New entries.
2016-09-02 21:04:49 +00:00
5ff4be2bd2 avr32: wire up preadv2 and pwritev2 syscalls
* linux/avr32/syscallent.h [326]: Add preadv2 entry.
[327]: Add pwritev2 entry.
2016-09-05 13:04:29 +00:00
0c766339fe 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-05 01:31:14 +00:00
6f9aefde21 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.
2016-09-02 17:42:42 +00:00
8bb9f473e4 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.
2016-09-02 17:21:14 +00:00
243e1a909c tests/futex: increase sprintrc static buffer size
* tests/futex.c (sprintrc): Increase buffer size from 256 to 4096.
2016-09-02 17:20:04 +00:00
100a7f2f8d tests/futex: rename retstr to sprintrc
* tests/futex.c (retstr): Rename to sprintrc.
(main): Convert all retstr calls to sprintrc.
2016-09-02 17:19:17 +00:00
680d0e960c 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-09-01 15:18:11 +00:00
db4ef238bd 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 16:31:53 +00:00
ca7c8952ea tests: add sign_extend_unsigned_to_ll macro
* tests/tests.h (sign_extend_unsigned_to_ll): New macro from defs.h.
2016-08-31 16:09:24 +00:00
2909c7c1d8 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 15:41:41 +00:00
e31e2c0e57 Update TCP* constants
* xlat/socktcpoptions.in: Add TCP_REPAIR_WINDOW introduced by linux
kernel commit v4.8-rc1~140^2~226.
2016-08-31 08:49:31 +00:00
80b49fb4dc 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.
2016-08-30 18:22:41 +00:00
9c3f5daa16 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.
2016-08-30 18:19:16 +00:00
6d68e0d4dd Update KEXEC_ARCH_* constants
* xlat/kexec_arch_values.in: Add KEXEC_ARCH_AARCH64 introduced by linux
kernel commit v4.8-rc1~16^2~41.
2016-08-30 18:13:38 +00:00
788e5f37d3 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.
2016-08-30 18:11:13 +00:00
3b9e6a34b8 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 18:01:50 +00:00
78b0755828 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 17:44:33 +00:00
c47beb7091 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 17:38:37 +00:00
a7857e50e4 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 17:38:37 +00:00
c965bec3a1 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 17:38:26 +00:00
d02a91dd2c futex: do not pretend <linux/futex.h> is included
As configure.ac does not check for linux/futex.h, HAVE_LINUX_FUTEX_H is
never defined and therefore the inclusion of <linux/futex.h> guarded by
HAVE_LINUX_FUTEX_H makes no sense.

Moreover, <linux/futex.h> 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 17:29:28 +00:00
110da33aff 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 17:29:28 +00:00
606d4b2d54 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 17:26:58 +00:00
ebeae24de4 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 15:53:51 +00:00
3e0e10532d 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 15:53:51 +00:00
a3e1ad344b 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 15:53:51 +00:00
bfa22a596f 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 15:53:51 +00:00
b80894cf07 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 <jrtc27@jrtc27.com>.
2016-08-30 15:50:36 +00:00
ae914db459 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 09:12:06 +00:00
e2ea606a60 Remove unused autoconf macro AC_TYPE_GETGROUPS
strace code does not use GETGROUPS_T.

* configure.ac (AC_TYPE_GETGROUPS): Remove.
2016-08-30 00:56:13 +00:00
730c49fb2a Remove unused autoconf macro AC_TYPE_MODE_T
strace code already redefines mode_t.

* configure.ac (AC_TYPE_MODE_T): Remove.
2016-08-30 00:56:04 +00:00
b4a32f9e57 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-30 00:48:36 +00:00
fcfdf89b8e 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 16:18:11 +00:00
79396167dd Remove unneeded autoconf macro AC_HEADER_DIRENT
strace code already includes <dirent.h> unconditionally.

* configure.ac (AC_HEADER_DIRENT): Remove.
2016-08-29 16:09:57 +00:00
39888f9358 Remove unneeded autoconf macro AC_HEADER_STDBOOL
strace code assumes C99.

* configure.ac (AC_HEADER_STDBOOL): Remove.
* defs.h: Include <stdbool.h> unconditionally.
2016-08-28 00:03:14 +00:00
5670786bcd 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-27 23:42:29 +00:00
50608a4098 Do not use AC_HEADER_MAJOR, include <sys/sysmacros.h> unconditionally
glibc, starting with commit glibc-2.24-28-gdbab657, has deprecated
inclusion of <sys/sysmacros.h> by <sys/types.h>.  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 <sys/sysmacros.h>.

* configure.ac (AC_HEADER_MAJOR): Remove.
* mknod.c [MAJOR_IN_SYSMACROS, MAJOR_IN_MKDEV]: Remove.
Include <sys/sysmacros.h> unconditionally.
* print_struct_stat.c: Likewise.
* tests/mknod.c: Likewise.
* tests/mknodat.c: Likewise.
* tests/xstatx.c: Likewise.
2016-08-29 15:36:02 +00:00
e7d3d645ae 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 15:30:45 +00:00
27a1a3f3eb 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-29 15:30:21 +00:00
6fc53380c6 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 3fb84bfc79.

* tests/xstatx.c (create_sample) [__mips64]: Remove.
2016-08-24 15:33:34 +00:00
a7c4ee41ff 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 15:32:10 +00:00
c778f7aff6 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 12:10:55 +00:00
a27c47b2c4 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 12:10:55 +00:00
1aae061d4d 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 12:10:55 +00:00
1d81b3b35f x86_64: provide a replacement of <asm/stat.h> 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 12:10:50 +00:00
cbb95b6c6a 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-24 12:09:59 +00:00
c4da489a74 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 15:06:34 +00:00
788939b4a7 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 15:06:34 +00:00
b685f90eb7 Add sign_extend_unsigned_to_ll macro
* defs.h (sign_extend_unsigned_to_ll): New macro, mirrors
zero_extend_signed_to_ull.
2016-08-23 00:24:22 +00:00
b2dd46398f zero_extend_signed_to_ull: add short int support
* defs.h (zero_extend_signed_to_ull): Add short int support.
* tests/tests.h: Likewise.
2016-08-23 00:24:17 +00:00
031fc80059 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 00:24:10 +00:00
3cac5ddd01 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-23 00:24:03 +00:00
5f5fd0d6e2 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 09:35:13 +00:00
bce8163937 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 09:32:47 +00:00
b53f546d3e 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-22 09:32:47 +00:00
d8f673568b 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.

Signed-off-by: Richard W.M. Jones <rjones@redhat.com>
2016-08-21 22:03:05 +00:00
714a162048 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 22:02:20 +00:00
ae5feb49c2 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-21 22:02:09 +00:00
aa0c46ffed 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-20 00:08:10 +00:00
3dfed0ef4e 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-19 22:57:27 +00:00
a48bbc70e8 sparc64: fix sparc personality decoding of mmap64's offset argument
* linux/sparc64/syscallent1.h: Remove redirection of sys_mmap_4koff.
2016-08-18 22:33:12 +00:00
1a6470fc80 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-19 22:11:46 +00:00
4b69c4736c Add sparc64 specific ptrace constants
* xlat/ptrace_cmds.in: Add PTRACE_GETREGS64, PTRACE_SETREGS64,
PTRACE_GETFPREGS64, and PTRACE_SETFPREGS64.
2016-08-16 09:15:44 +00:00
daa04830aa 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 09:15:36 +00:00
23a51410ba 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-16 09:15:24 +00:00
7af5e6593f evdev.c: fix typo in comment 2016-08-15 21:08:56 +00:00
7e2fe5029a 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 19:09:24 +00:00
18cac625e5 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 22:06:06 +03:00
472ce30535 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-15 22:06:06 +03:00
aaa7a77b5f 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 00:03:03 +00:00
8e982692d4 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-14 00:02:55 +00:00
7c6e8f1490 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.
2016-08-13 22:05:28 +00:00
e4e9df2259 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 22:05:20 +00:00
559ec3e06d 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-13 22:04:59 +00:00
c65e6b9989 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 01:00:04 +00:00
ad109aba29 tests: fix *stat64 tests on alpha
On some architectures including alpha, <asm/stat.h> 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-12 00:07:54 +00:00
67ee3d6184 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 17:58:09 +00:00
a9147beeb0 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 16:48:12 +00:00
468dccf59d 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 16:47:29 +00:00
3fb84bfc79 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 16:45:23 +00:00
0bc735e5aa 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 <james410@cowgill.org.uk>
2016-08-11 11:18:56 +00:00
6a2f43ce64 Use <asm/unistd.h> instead of <sys/syscall.h>
There are no users of SYS_* macros provided by <sys/syscall.h>,
and definitions of __NR_* macros could be obtained directly
from <asm/unistd.h>.

* defs.h: Include <asm/unistd.h> instead of <sys/syscall.h>.
* 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 14:38:29 +00:00
38d854e425 ia64: replace SYS_clone2 with __NR_clone2
Migrate to __NR_* the last user of SYS_* macros provided
by <sys/syscall.h>.

* clone.c [IA64] (ARG_STACKSIZE, ARG_PTID, ARG_CTID, ARG_TLS): Replace
SYS_clone2 with __NR_clone2.
2016-08-09 14:35:06 +00:00
e3dfc5901f 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 10:34:09 +00:00
09dee9ab25 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 10:27:50 +00:00
5179183b49 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 09:21:46 +00:00
deb3bce1a2 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 09:14:11 +00:00
60d7ec80d9 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-09 01:13:24 +00:00
c61dd7f4d2 linux/subcall.h: remove redundant definitions
* linux/subcall.h: Remove definitions of non-existent socket
and ipc subcalls.
2016-08-08 23:43:50 +00:00
f2107d57e4 defs.h: simplify SUPPORTED_PERSONALITIES definition
* defs.h: Group definition of SUPPORTED_PERSONALITIES by value.
2016-08-08 23:28:29 +00:00
abfc0a6d59 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 23:28:29 +00:00
8d92151c66 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 23:28:29 +00:00
aebfe832b8 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 23:27:08 +00:00
90a65a4aab 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-08 21:11:47 +00:00
42ceb0fd7f 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-07 22:02:46 +00:00
18907920bb 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-08 09:54:01 +00:00
7b1401e965 tests: add #include guards
* tests/tests.h: Add #include guard.
2016-08-06 21:51:29 +00:00
3c8149a0f2 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-05 15:06:43 +00:00
08601fdc68 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 12:11:19 +00:00
f4001a3d12 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-04 01:10:05 +00:00
8d3743868e 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-03 23:27:03 +00:00
c416ff5ffa 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.
2016-08-02 16:47:34 +00:00
09fc30c4c7 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.
2016-08-02 16:43:37 +00:00
8df052e2ae 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.
2016-08-02 16:33:09 +00:00
79bbee8368 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.
2016-08-02 11:11:52 +00:00
884e1e930b 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-08-02 11:00:06 +00:00
4f328761f3 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-31 21:55:23 +00:00
c4fdce5cea 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-30 22:52:27 +00:00
b9bc216fdd 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.
2016-07-29 22:47:46 +00:00
2ddb73ddd3 Attach to the target process before attempting to attach to its siblings
* strace.c (attach_tcb): Attach to tcp->pid first.
2016-07-29 17:14:28 +00:00
c9251518b0 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.
2016-07-29 17:13:53 +00:00
795795ae99 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.
2016-07-29 17:13:47 +00:00
bbfeea269e startup_attach: do not use atoi
* strace.c (startup_attach): Replace atoi with string_to_uint.
2016-07-29 17:10:50 +00:00
6d3162acf1 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 18:32:29 +00:00
8ff8ada6ee 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 18:32:29 +00:00
a290710b1b 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 18:32:28 +00:00
f915f220c0 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 18:32:28 +00:00
469fd109cd 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 18:32:18 +00:00
1b2500c6bf tests: fix extended regexps
* tests/adjtimex.c (main): Consistently quote curly braces
in expected output.
* tests/uio.expected: Likewise.
2016-07-28 00:06:46 +00:00
1514448dad 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-27 09:19:37 +00:00
462 changed files with 8167 additions and 3574 deletions

View File

@ -1,7 +1,9 @@
# Map git author names and email addresses to canonical/preferred form.
<ak@linux.intel.com> <ak@suse.de>
<dgilbert@redhat.com> <dave@treblig.org>
<holger@freyther.de> <zecke@selfish.org>
<kirill@shutemov.name> <kirill.shutemov@linux.intel.com>
<schwab@linux-m68k.org> <schwab@redhat.com>
<schwab@linux-m68k.org> <schwab@suse.de>
<vda.linux@googlemail.com> <dvlasenk@redhat.com>
Eugene Syromyatnikov <evgsyr@gmail.com>

View File

@ -39,3 +39,6 @@ matrix:
- compiler: clang-3.6
env:
- TARGET=x86
- compiler: musl-gcc
env:
- TARGET=x86

View File

@ -112,8 +112,9 @@ strace_SOURCES = \
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.c \
file_handle.c \
file_ioctl.c \
fs_x_ioctl.c \
@ -147,6 +148,7 @@ strace_SOURCES = \
link.c \
linux/asm_stat.h \
linux/x32/asm_stat.h \
linux/x86_64/asm_stat.h \
lookup_dcookie.c \
loop.c \
lseek.c \
@ -165,6 +167,7 @@ strace_SOURCES = \
net.c \
netlink.c \
numa.c \
oldstat.c \
open.c \
or1k_atomic.c \
pathtrace.c \
@ -176,13 +179,13 @@ strace_SOURCES = \
print_msgbuf.c \
print_sigevent.c \
print_statfs.c \
print_struct_stat.c \
print_time.c \
print_timex.c \
printmode.c \
printrusage.c \
printsiginfo.c \
printsiginfo.h \
printstat.h \
process.c \
process_vm.c \
ptp.c \
@ -209,6 +212,9 @@ strace_SOURCES = \
sockaddr.c \
socketutils.c \
sram_alloc.c \
stat.c \
stat.h \
stat64.c \
statfs.c \
statfs.h \
strace.c \
@ -250,7 +256,7 @@ endif
@CODE_COVERAGE_RULES@
CODE_COVERAGE_BRANCH_COVERAGE = 1
CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
--prefix $(shell realpath -Ls $(abs_top_srcdir)/..)
--prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
CODE_COVERAGE_IGNORE_PATTERN = '/usr/include/*'
strace_CPPFLAGS += $(CODE_COVERAGE_CPPFLAGS)
strace_CFLAGS += $(CODE_COVERAGE_CFLAGS)
@ -497,6 +503,18 @@ EXTRA_DIST = \
linux/powerpc64/syscallent1.h \
linux/powerpc64/userent.h \
linux/ptp_clock.h \
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/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 \
@ -713,7 +731,7 @@ ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(io
ioctl_redefs%.h: ioctlent%.h ioctlent0.h
sort $< > $<-t
sort ioctlent0.h | comm -23 $<-t - | \
sed -n 's/^{ "\([^"]\+\)", \(0x[[:xdigit:]]\+\) },$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
sed -r -n 's/^\{ "([^"]+)", (0x[[:xdigit:]]+) \},$$/#ifdef \1\n# undef \1\n# define \1 \2\n#endif/p' \
> $@-t
rm -f $<-t
mv $@-t $@
@ -754,7 +772,7 @@ libmpers_CFLAGS = $(strace_CFLAGS)
mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
for f in $^; do \
CC="$(CC)" CFLAGS="$(mpers_sh_opts)" \
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
@ -762,7 +780,7 @@ mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
m%_type_defs.h: $(srcdir_mpers_source_files)
for f in $^; do \
sed -n 's/^#include DEF_MPERS_TYPE(\([^)]\+\))/#ifdef MPERS_$(mpers_PREFIX)\1\n# define \1 MPERS_$(mpers_PREFIX)\1\n#endif/p' $$f || exit; \
sed -r -n 's/^#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
@ -772,7 +790,7 @@ m%_type_defs.h: $(srcdir_mpers_source_files)
m%_funcs.h: $(srcdir_mpers_source_files)
for f in $^; do \
sed -n 's/^SYS_FUNC(\([^)]\+\))/#undef sys_\1\n#define sys_\1 $(mpers_PREFIX)sys_\1/p' $$f || exit; \
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 $@
@ -782,13 +800,13 @@ m%_funcs.h: $(srcdir_mpers_source_files)
%.c.mpers.i: $(srcdir)/%.c
$(CPP) -P $(mpers_sh_opts) -DIN_MPERS_BOOTSTRAP $< -o $@
mpers_printer_decl_pattern = ^MPERS_PRINTER_DECL(\([^,)]\+\),[[:space:]]*\([^,)]\+\),[[:space:]]*\([^)]\+\))$$
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 -n 's/$(mpers_printer_decl_pattern)/ \1 (*\2)(\3);\n#define \2 MPERS_PRINTER_NAME(\2)\n/p' $$f \
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
@ -799,7 +817,7 @@ printers.h: $(mpers_preproc_files)
%_printer_decls.h: $(mpers_preproc_files)
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
sed -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
sed -r -n 's/$(mpers_printer_decl_pattern)/extern \1 $(mpers_PREFIX)\2(\3);/p' $$f \
|| exit; \
done >> $@-t
mv $@-t $@
@ -807,7 +825,7 @@ printers.h: $(mpers_preproc_files)
%_printer_defs.h: $(mpers_preproc_files)
echo '/* Generated by Makefile from $^; do not edit. */' > $@-t
for f in $^; do \
sed -n 's/$(mpers_printer_decl_pattern)/\.\2 = $(mpers_PREFIX)\2,/p' $$f \
sed -r -n 's/$(mpers_printer_decl_pattern)/.\2 = $(mpers_PREFIX)\2,/p' $$f \
|| exit; \
done >> $@-t
mv $@-t $@
@ -869,7 +887,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)}'; \

37
NEWS
View File

@ -1,3 +1,40 @@
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)
===============================================

36
aio.c
View File

@ -36,13 +36,13 @@ SYS_FUNC(io_setup)
if (entering(tcp))
tprintf("%u, ", (unsigned int) tcp->u_arg[0]);
else
printnum_ulong(tcp, tcp->u_arg[1]);
printnum_ptr(tcp, tcp->u_arg[1]);
return 0;
}
SYS_FUNC(io_destroy)
{
tprintf("%lu", tcp->u_arg[0]);
printaddr(tcp->u_arg[0]);
return RVAL_DECODED;
}
@ -78,12 +78,14 @@ tprint_lio_opcode(unsigned cmd)
}
static void
print_common_flags(const struct iocb *cb)
print_common_flags(struct tcb *tcp, const struct iocb *cb)
{
/* IOCB_FLAG_RESFD is available since v2.6.22-rc1~47 */
#ifdef IOCB_FLAG_RESFD
if (cb->aio_flags & IOCB_FLAG_RESFD)
tprintf(", resfd=%d", cb->aio_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
@ -98,7 +100,7 @@ iocb_is_valid(const struct iocb *cb)
}
static enum iocb_sub
print_iocb_header(const struct iocb *cb)
print_iocb_header(struct tcb *tcp, const struct iocb *cb)
{
enum iocb_sub sub;
@ -113,7 +115,8 @@ print_iocb_header(const struct iocb *cb)
if (cb->aio_reqprio)
tprintf(", reqprio=%hd", cb->aio_reqprio);
tprintf(", fildes=%d", cb->aio_fildes);
tprints(", fildes=");
printfd(tcp, cb->aio_fildes);
return sub;
}
@ -121,7 +124,7 @@ print_iocb_header(const struct iocb *cb)
static void
print_iocb(struct tcb *tcp, const struct iocb *cb)
{
enum iocb_sub sub = print_iocb_header(cb);
enum iocb_sub sub = print_iocb_header(tcp, cb);
switch (sub) {
case SUB_COMMON:
@ -134,7 +137,7 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
}
tprintf(", nbytes=%" PRIu64 ", offset=%" PRId64,
(uint64_t) cb->aio_nbytes, (int64_t) cb->aio_offset);
print_common_flags(cb);
print_common_flags(tcp, cb);
break;
case SUB_VECTOR:
if (iocb_is_valid(cb)) {
@ -149,7 +152,7 @@ print_iocb(struct tcb *tcp, const struct iocb *cb)
(uint64_t) cb->aio_nbytes);
}
tprintf(", offset=%" PRId64, (int64_t) cb->aio_offset);
print_common_flags(cb);
print_common_flags(tcp, cb);
break;
case SUB_NONE:
break;
@ -182,7 +185,8 @@ SYS_FUNC(io_submit)
const unsigned long addr = tcp->u_arg[2];
unsigned long iocbp;
tprintf("%lu, %ld, ", tcp->u_arg[0], nr);
printaddr(tcp->u_arg[0]);
tprintf(", %ld, ", nr);
if (nr < 0)
printaddr(addr);
@ -209,12 +213,14 @@ print_io_event(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
SYS_FUNC(io_cancel)
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
printaddr(tcp->u_arg[0]);
tprints(", ");
struct iocb cb;
if (!umove_or_printaddr(tcp, tcp->u_arg[1], &cb)) {
tprints("{");
print_iocb_header(&cb);
print_iocb_header(tcp, &cb);
tprints("}");
}
tprints(", ");
@ -230,8 +236,8 @@ SYS_FUNC(io_cancel)
SYS_FUNC(io_getevents)
{
if (entering(tcp)) {
tprintf("%lu, %ld, %ld, ",
tcp->u_arg[0],
printaddr(tcp->u_arg[0]);
tprintf(", %ld, %ld, ",
widen_to_long(tcp->u_arg[1]),
widen_to_long(tcp->u_arg[2]));
} else {

View File

@ -5,7 +5,9 @@ for m in m32 mx32; do
rm -rf $tests
mkdir $tests
s='[[:space:]]*'
sed "s/@arch@/@arch_$m@/;s/^MPERS_NAME$s=.*/& $m/;s/^ARCH_MFLAGS$s=.*/& -$m/" \
sed "s/@arch@/@arch_$m@/;
s/^MPERS_NAME$s=.*/& $m/;
s/^ARCH_MFLAGS$s=.*/& -DMPERS_IS_\$(MPERS_NAME) -$m/" \
tests/Makefile.am > $tests/Makefile.am
for f in tests/*; do
case "${f##*/}" in

21
btrfs.c
View File

@ -32,6 +32,7 @@
#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 <linux/btrfs.h>
@ -41,6 +42,8 @@ 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 */
@ -373,14 +376,14 @@ print_uint64(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
}
static void
btrfs_print_qgroup_inherit(struct tcb *tcp, const uint64_t qgi_addr)
btrfs_print_qgroup_inherit(struct tcb *tcp, const unsigned long qgi_addr)
{
struct btrfs_qgroup_inherit inherit;
if (umove_or_printaddr(tcp, qgi_addr, &inherit))
return;
tprintf("{flags=");
tprints("{flags=");
printflags64(btrfs_qgroup_inherit_flags, inherit.flags,
"BTRFS_QGROUP_INHERIT_???");
tprintf(", num_qgroups=%" PRI__u64 ", num_ref_copies=%" PRI__u64
@ -420,7 +423,7 @@ 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)) {
tprintf("{key={tree_id=");
tprints("{key={tree_id=");
btrfs_print_objectid(key->tree_id);
if (key->min_objectid != BTRFS_FIRST_FREE_OBJECTID ||
@ -1294,7 +1297,7 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
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;
struct_btrfs_ioctl_vol_args_v2 args;
if (entering(tcp))
tprints(", ");
@ -1313,19 +1316,19 @@ MPERS_PRINTER_DECL(int, btrfs_ioctl,
printflags64(btrfs_snap_flags_v2, args.flags,
"BTRFS_SUBVOL_???");
if (args.flags & BTRFS_SUBVOL_QGROUP_INHERIT) {
tprintf(", size=%" PRI__u64 ", qgroup_inherit=",
args.size);
tprintf(", size=%llu, qgroup_inherit=",
(unsigned long long) args.size);
btrfs_print_qgroup_inherit(tcp,
(unsigned long)args.qgroup_inherit);
(unsigned long) args.qgroup_inherit);
}
tprintf(", name=");
tprints(", name=");
print_quoted_string(args.name, sizeof(args.name),
QUOTE_0_TERMINATED);
tprints("}");
return 0;
}
tprintf("{transid=%" PRI__u64 "}", args.transid);
tprintf("{transid=%llu}", (unsigned long long) args.transid);
break;
}

View File

@ -4,7 +4,8 @@ static void
decode_chmod(struct tcb *tcp, const int offset)
{
printpath(tcp, tcp->u_arg[offset]);
tprintf(", %#lo", tcp->u_arg[offset + 1]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[offset + 1]);
}
SYS_FUNC(chmod)
@ -25,7 +26,8 @@ SYS_FUNC(fchmodat)
SYS_FUNC(fchmod)
{
printfd(tcp, tcp->u_arg[0]);
tprintf(", %#lo", tcp->u_arg[1]);
tprints(", ");
print_numeric_umode_t(tcp->u_arg[1]);
return RVAL_DECODED;
}

10
clone.c
View File

@ -42,10 +42,10 @@
#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)
# 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
@ -59,7 +59,7 @@
# 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
#elif defined ALPHA || defined TILE || defined OR1K || defined RISCV
# define ARG_FLAGS 0
# define ARG_STACK 1
# define ARG_PTID 2

View File

@ -187,6 +187,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])
@ -202,6 +207,7 @@ AC_SUBST(arch)
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],
@ -229,7 +235,9 @@ if test "$arch" = mips; then
n64) AC_DEFINE([LINUX_MIPSN64], [1], [Define for _MIPS_SIM_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],
@ -267,22 +275,13 @@ AC_ARG_ENABLE([gcc-Werror],
AC_SUBST([WARN_CFLAGS])
AC_C_BIGENDIAN
AC_C_CONST
AC_C_TYPEOF
AC_TYPE_GETGROUPS
AC_TYPE_MODE_T
AC_TYPE_SIGNAL
AC_TYPE_UID_T
AC_HEADER_DIRENT
AC_HEADER_MAJOR
AC_HEADER_STAT
AC_HEADER_STDBOOL
AC_HEADER_STDC
AC_CHECK_FUNCS(m4_normalize([
accept4
fallocate
fanotify_mark
fopen64
fork
@ -297,7 +296,7 @@ AC_CHECK_FUNCS(m4_normalize([
preadv
process_vm_readv
pwritev
sigaction
readahead
signalfd
stpcpy
strerror
@ -317,6 +316,12 @@ AC_CHECK_TYPES([struct stat64, struct __old_kernel_stat],,,
[#include <sys/types.h>
#include <asm/stat.h>])
AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
[#include <sys/types.h>
#include <asm/stat.h>])
AC_CHECK_MEMBERS([struct stat.st_mtim.tv_nsec])
AC_CHECK_TYPES(m4_normalize([
struct pt_all_user_regs,
struct ia64_fpreg,
@ -332,29 +337,10 @@ AC_CHECK_TYPES(m4_normalize([
[#include <sys/types.h>
#include <linux/fcntl.h>])
AC_CHECK_MEMBERS(m4_normalize([
struct stat.st_atim.tv_nsec,
struct stat.st_blksize,
struct stat.st_blocks,
struct stat.st_ctim.tv_nsec,
struct stat.st_flags,
struct stat.st_fstype,
struct stat.st_gen,
struct stat.st_mtim.tv_nsec,
struct stat.st_rdev
]))
AC_CHECK_MEMBERS([struct timex.tai],,, [#include <sys/timex.h>])
AC_CHECK_MEMBERS([struct utsname.domainname],,, [#include <sys/utsname.h>])
AC_CHECK_MEMBERS(m4_normalize([
struct stat.st_atime_nsec,
struct stat.st_ctime_nsec,
struct stat.st_mtime_nsec
]),,, [#include <sys/types.h>
#include <asm/stat.h>])
AC_CHECK_MEMBERS(m4_normalize([
siginfo_t.si_syscall,
siginfo_t.si_timerid,
@ -368,6 +354,7 @@ AC_CHECK_HEADERS(m4_normalize([
elf.h
inttypes.h
linux/bsg.h
linux/dqblk_xfs.h
linux/falloc.h
linux/fiemap.h
linux/filter.h
@ -377,6 +364,7 @@ AC_CHECK_HEADERS(m4_normalize([
linux/mmtimer.h
linux/msg.h
linux/perf_event.h
linux/quota.h
linux/seccomp.h
linux/securebits.h
linux/sem.h
@ -393,6 +381,7 @@ AC_CHECK_HEADERS(m4_normalize([
sys/fanotify.h
sys/ipc.h
sys/msg.h
sys/quota.h
sys/reg.h
sys/sem.h
sys/shm.h

6
debian/changelog.in vendored
View File

@ -4,6 +4,12 @@ strace (@PACKAGE_VERSION@-1) experimental; urgency=low
-- Strace <@PACKAGE_BUGREPORT@> @DEB_CHANGELOGTIME@
strace (4.13-1) unstable; urgency=medium
* New upstream version.
-- Dmitry V. Levin <ldv@altlinux.org> 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

217
defs.h
View File

@ -27,20 +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
#include <features.h>
#ifdef HAVE_STDBOOL_H
# include <stdbool.h>
#endif
#include <stdbool.h>
#include <stdint.h>
#include <inttypes.h>
#include <sys/types.h>
#ifdef STDC_HEADERS
# include <stddef.h>
#endif
#include <stddef.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
@ -52,7 +51,7 @@
#include <errno.h>
#include <time.h>
#include <sys/time.h>
#include <sys/syscall.h>
#include <asm/unistd.h>
#include "mpers_type.h"
#include "gcc_compat.h"
@ -69,11 +68,6 @@ const char *strerror(int);
extern char *stpcpy(char *dst, const char *src);
#endif
#ifndef offsetof
# define offsetof(type, member) \
(((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL))
#endif
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
/* macros */
@ -148,130 +142,53 @@ extern char *stpcpy(char *dst, const char *src);
# define ERESTART_RESTARTBLOCK 516
#endif
#if defined(SPARC) || defined(SPARC64)
# define PERSONALITY0_WORDSIZE 4
# if defined(SPARC64)
# define SUPPORTED_PERSONALITIES 2
# define PERSONALITY1_WORDSIZE 8
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
# endif
#endif
#ifdef X86_64
#if defined X86_64
# define SUPPORTED_PERSONALITIES 3
# define PERSONALITY0_WORDSIZE 8
# define PERSONALITY1_WORDSIZE 4
# define PERSONALITY2_WORDSIZE 4
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
# ifdef 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"
# endif
#endif
#ifdef X32
#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
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
#endif
#ifdef ARM
/* one personality */
#endif
#ifdef AARCH64
/* The existing ARM personality, then AArch64 */
# define SUPPORTED_PERSONALITIES 2
# define PERSONALITY0_WORDSIZE 8
# define PERSONALITY1_WORDSIZE 4
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
#endif
#ifdef POWERPC64
# define SUPPORTED_PERSONALITIES 2
# define PERSONALITY0_WORDSIZE 8
# define PERSONALITY1_WORDSIZE 4
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
#endif
#ifdef TILE
# define SUPPORTED_PERSONALITIES 2
# define PERSONALITY0_WORDSIZE 8
# define PERSONALITY1_WORDSIZE 4
# ifdef __tilepro__
# define DEFAULT_PERSONALITY 1
# endif
# ifdef HAVE_M32_MPERS
# define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DECLS "m32_printer_decls.h"
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
# define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
# endif
#endif
#ifndef SUPPORTED_PERSONALITIES
#else
# define SUPPORTED_PERSONALITIES 1
#endif
#ifndef DEFAULT_PERSONALITY
#if defined TILE && defined __tilepro__
# define DEFAULT_PERSONALITY 1
#else
# define DEFAULT_PERSONALITY 0
#endif
#ifndef PERSONALITY0_WORDSIZE
# define PERSONALITY0_WORDSIZE SIZEOF_LONG
#define PERSONALITY0_WORDSIZE SIZEOF_LONG
#define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
#define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
#if SUPPORTED_PERSONALITIES > 1
# define PERSONALITY1_WORDSIZE 4
#endif
#ifndef PERSONALITY0_INCLUDE_PRINTERS_DECLS
# define PERSONALITY0_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
#endif
#ifndef PERSONALITY0_INCLUDE_PRINTERS_DEFS
# define PERSONALITY0_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
#endif
#ifndef PERSONALITY1_INCLUDE_PRINTERS_DECLS
#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"
#endif
#ifndef PERSONALITY1_INCLUDE_PRINTERS_DEFS
# define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
#endif
#ifndef PERSONALITY2_INCLUDE_PRINTERS_DECLS
# define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
#endif
#ifndef PERSONALITY2_INCLUDE_PRINTERS_DEFS
# define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
#endif
#ifndef PERSONALITY1_INCLUDE_FUNCS
# define PERSONALITY1_INCLUDE_FUNCS "empty.h"
#endif
#ifndef PERSONALITY2_INCLUDE_FUNCS
#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
@ -299,7 +216,7 @@ 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 */
unsigned long u_error; /* Error code */
long scno; /* System call number */
long u_arg[MAX_ARGS]; /* System call arguments */
#if HAVE_STRUCT_TCB_EXT_ARG
@ -432,6 +349,7 @@ extern const struct xlat whence_codes[];
|| defined(BFIN) \
|| defined(M68K) \
|| defined(MICROBLAZE) \
|| defined(RISCV) \
|| defined(S390) \
|| defined(SH) || defined(SH64) \
|| defined(SPARC) || defined(SPARC64) \
@ -528,6 +446,7 @@ extern void clear_regs(void);
extern void get_regs(pid_t pid);
extern int get_scno(struct tcb *tcp);
extern const char *syscall_name(long scno);
extern const char *err_name(unsigned long err);
extern bool is_erestart(struct tcb *);
extern void temporarily_clear_syserror(struct tcb *);
@ -594,8 +513,9 @@ extern unsigned long get_pagesize(void);
extern int string_to_uint(const char *str);
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_0_TERMINATED 0x01
#define QUOTE_OMIT_LEADING_TRAILING_QUOTES 0x02
#define QUOTE_OMIT_TRAILING_0 0x08
extern int string_quote(const char *, char *, unsigned int, unsigned int);
extern int print_quoted_string(const char *, unsigned int, unsigned int);
@ -617,6 +537,8 @@ extern int printllval(struct tcb *, const char *, int)
extern void printaddr(long);
extern void printxvals(const uint64_t, const char *, const struct xlat *, ...)
ATTRIBUTE_SENTINEL;
extern long long getarg_ll(struct tcb *tcp, int argn);
extern unsigned long long getarg_ull(struct tcb *tcp, int argn);
extern int printargs(struct tcb *);
extern int printargs_u(struct tcb *);
extern int printargs_d(struct tcb *);
@ -624,15 +546,18 @@ 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 *sprintmode(unsigned int);
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 dumpiov_in_msghdr(struct tcb *, long, unsigned long);
extern void dumpiov_in_mmsghdr(struct tcb *, long);
extern void dumpiov_upto(struct tcb *, int, long, unsigned long);
#define dumpiov(tcp, len, addr) \
dumpiov_upto((tcp), (len), (addr), (unsigned long) -1L)
extern void dumpstr(struct tcb *, long, int);
extern void printstr(struct tcb *, long, long);
extern void printstr_ex(struct tcb *, long addr, long len,
unsigned int user_style);
extern bool printnum_short(struct tcb *, long, const char *)
ATTRIBUTE_FORMAT((printf, 3, 0));
extern bool printnum_int(struct tcb *, long, const char *)
@ -702,6 +627,9 @@ extern const char *sprint_open_modes(unsigned int);
extern void print_seccomp_filter(struct tcb *, unsigned long);
extern void print_seccomp_fprog(struct tcb *, unsigned long, unsigned short);
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 *tcp, long);
extern void print_struct_statfs64(struct tcb *tcp, long, unsigned long);
@ -735,6 +663,12 @@ extern void unwind_print_stacktrace(struct tcb* tcp);
extern void unwind_capture_stacktrace(struct tcb* tcp);
#endif
static inline void
printstr(struct tcb *tcp, long addr, long len)
{
printstr_ex(tcp, addr, len, 0);
}
static inline int
printflags(const struct xlat *x, unsigned int flags, const char *dflt)
{
@ -818,13 +752,25 @@ extern unsigned current_wordsize;
#endif
/*
* Widen without sign-extension a signed integer type to unsigned long long.
* Zero-extend a signed integer type to unsigned long long.
*/
#define widen_to_ull(v) \
(sizeof(v) == sizeof(int) ? (unsigned long long) (unsigned int) (v) : \
#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[];
@ -863,10 +809,13 @@ extern unsigned num_quals;
#endif /* !IN_MPERS_BOOTSTRAP */
/*
* If you need non-NULL sysent[scno].sys_func and sysent[scno].sys_name
* If you need non-NULL sysent[scno].sys_func, non-NULL sysent[scno].sys_name,
* and non-indirect sysent[scno].sys_flags.
*/
#define SCNO_IS_VALID(scno) \
((unsigned long)(scno) < nsyscalls && sysent[scno].sys_func)
((unsigned long)(scno) < nsyscalls \
&& sysent[scno].sys_func \
&& !(sysent[scno].sys_flags & TRACE_INDIRECT_SUBCALL))
/* Only ensures that sysent[scno] isn't out of range */
#define SCNO_IN_RANGE(scno) \
@ -899,3 +848,5 @@ extern unsigned num_quals;
#define PRI__d64 PRI__64"d"
#define PRI__u64 PRI__64"u"
#define PRI__x64 PRI__64"x"
#endif /* !STRACE_DEFS_H */

View File

@ -48,8 +48,8 @@ print_old_dirent(struct tcb *tcp, long addr)
return;
tprintf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=",
widen_to_ull(d.d_ino),
widen_to_ull(d.d_off), d.d_reclen);
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);
@ -127,8 +127,9 @@ SYS_FUNC(getdents)
tprintf("%s{d_ino=%llu, d_off=%llu, d_reclen=%u"
", d_name=", i ? ", " : "",
widen_to_ull(d->d_ino),
widen_to_ull(d->d_off), d->d_reclen);
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) {

View File

@ -37,7 +37,7 @@
typedef struct ff_effect struct_ff_effect;
#endif /* HAVE_LINUX_BTRFS_H */
#endif /* HAVE_LINUX_INPUT_H */
#include MPERS_DEFS

View File

@ -42,7 +42,7 @@ SYS_FUNC(fadvise64)
printfd(tcp, tcp->u_arg[0]);
argn = printllval(tcp, ", %lld", 1);
tprintf(", %ld, ", tcp->u_arg[argn++]);
tprintf(", %llu, ", getarg_ull(tcp, argn++));
printxval(advise, tcp->u_arg[argn], "POSIX_FADV_???");
return RVAL_DECODED;

View File

@ -19,10 +19,10 @@ SYS_FUNC(fallocate)
tprints(", ");
/* offset */
argn = printllval(tcp, "%llu, ", 2);
argn = printllval(tcp, "%lld, ", 2);
/* len */
printllval(tcp, "%llu", argn);
printllval(tcp, "%lld", argn);
return RVAL_DECODED;
}

102
fetch_struct_stat.c Normal file
View File

@ -0,0 +1,102 @@
/*
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING 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 *tcp, const unsigned long 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
}

100
fetch_struct_stat64.c Normal file
View File

@ -0,0 +1,100 @@
/*
* Copyright (c) 2014-2016 Dmitry V. Levin <ldv@altlinux.org>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING 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 *tcp, const unsigned long 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
}

View File

@ -47,26 +47,26 @@ MPERS_PRINTER_DECL(bool, fetch_struct_statfs,
if (umove_or_printaddr(tcp, addr, &b))
return false;
p->f_type = widen_to_ull(b.f_type);
p->f_bsize = widen_to_ull(b.f_bsize);
p->f_blocks = widen_to_ull(b.f_blocks);
p->f_bfree = widen_to_ull(b.f_bfree);
p->f_bavail = widen_to_ull(b.f_bavail);
p->f_files = widen_to_ull(b.f_files);
p->f_ffree = widen_to_ull(b.f_ffree);
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] = widen_to_ull(b.f_fsid.val[0]);
p->f_fsid[1] = widen_to_ull(b.f_fsid.val[1]);
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] = widen_to_ull(b.f_fsid.__val[0]);
p->f_fsid[1] = widen_to_ull(b.f_fsid.__val[1]);
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 = widen_to_ull(b.f_namelen);
p->f_namelen = zero_extend_signed_to_ull(b.f_namelen);
#ifdef HAVE_STRUCT_STATFS_F_FRSIZE
p->f_frsize = widen_to_ull(b.f_frsize);
p->f_frsize = zero_extend_signed_to_ull(b.f_frsize);
#endif
#ifdef HAVE_STRUCT_STATFS_F_FLAGS
p->f_flags = widen_to_ull(b.f_flags);
p->f_flags = zero_extend_signed_to_ull(b.f_flags);
#endif
return true;
@ -95,26 +95,26 @@ MPERS_PRINTER_DECL(bool, fetch_struct_statfs64,
if (umove_or_printaddr(tcp, addr, &b))
return false;
p->f_type = widen_to_ull(b.f_type);
p->f_bsize = widen_to_ull(b.f_bsize);
p->f_blocks = widen_to_ull(b.f_blocks);
p->f_bfree = widen_to_ull(b.f_bfree);
p->f_bavail = widen_to_ull(b.f_bavail);
p->f_files = widen_to_ull(b.f_files);
p->f_ffree = widen_to_ull(b.f_ffree);
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] = widen_to_ull(b.f_fsid.val[0]);
p->f_fsid[1] = widen_to_ull(b.f_fsid.val[1]);
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] = widen_to_ull(b.f_fsid.__val[0]);
p->f_fsid[1] = widen_to_ull(b.f_fsid.__val[1]);
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 = widen_to_ull(b.f_namelen);
p->f_namelen = zero_extend_signed_to_ull(b.f_namelen);
#ifdef HAVE_STRUCT_STATFS64_F_FRSIZE
p->f_frsize = widen_to_ull(b.f_frsize);
p->f_frsize = zero_extend_signed_to_ull(b.f_frsize);
#endif
#ifdef HAVE_STRUCT_STATFS64_F_FLAGS
p->f_flags = widen_to_ull(b.f_flags);
p->f_flags = zero_extend_signed_to_ull(b.f_flags);
#endif
return true;

493
file.c
View File

@ -1,493 +0,0 @@
/*
* Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
* Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
* Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
* Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. The name of the author may not be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING 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"
#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 "asm_stat.h"
#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
/* for S_IFMT */
#define stat libc_stat
#define stat64 libc_stat64
#include <sys/stat.h>
#undef stat
#undef stat64
/* These might be macros. */
#undef st_atime
#undef st_mtime
#undef st_ctime
#if defined MAJOR_IN_SYSMACROS
# include <sys/sysmacros.h>
#elif defined MAJOR_IN_MKDEV
# include <sys/mkdev.h>
#endif
/* several stats */
#include "printstat.h"
/* all locally defined structures provide these fields */
#undef HAVE_STRUCT_STAT_ST_ATIME_NSEC
#define HAVE_STRUCT_STAT_ST_ATIME_NSEC 1
#undef HAVE_STRUCT_STAT_ST_CTIME_NSEC
#define HAVE_STRUCT_STAT_ST_CTIME_NSEC 1
#undef HAVE_STRUCT_STAT_ST_MTIME_NSEC
#define HAVE_STRUCT_STAT_ST_MTIME_NSEC 1
#undef STAT32_PERSONALITY
#if SUPPORTED_PERSONALITIES > 1
# if defined AARCH64 || defined X86_64 || defined X32
struct stat32 {
unsigned int st_dev;
unsigned int st_ino;
unsigned short st_mode;
unsigned short st_nlink;
unsigned short st_uid;
unsigned short 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;
};
# define STAT32_PERSONALITY 1
# elif defined POWERPC64
struct stat32 {
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;
};
# define STAT32_PERSONALITY 1
# elif defined SPARC64
struct stat32 {
unsigned short st_dev;
unsigned int 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_atime_nsec;
unsigned int st_mtime;
unsigned int st_mtime_nsec;
unsigned int st_ctime;
unsigned int st_ctime_nsec;
unsigned int st_blksize;
unsigned int st_blocks;
unsigned int __unused4[2];
};
# define STAT32_PERSONALITY 0
# elif defined SPARC
# /* no 64-bit personalities */
# elif defined TILE
# /* no 32-bit stat */
# else
# warning FIXME: check whether struct stat32 definition is needed for this architecture!
# endif /* X86_64 || X32 || POWERPC64 */
#endif /* SUPPORTED_PERSONALITIES > 1 */
#ifdef STAT32_PERSONALITY
# define DO_PRINTSTAT do_printstat32
# define STRUCT_STAT struct stat32
# undef HAVE_STRUCT_STAT_ST_FLAGS
# undef HAVE_STRUCT_STAT_ST_FSTYPE
# undef HAVE_STRUCT_STAT_ST_GEN
# include "printstat.h"
#endif /* STAT32_PERSONALITY */
#if defined(SPARC) || defined(SPARC64)
struct solstat {
unsigned st_dev;
unsigned int st_pad1[3]; /* network id */
unsigned st_ino;
unsigned st_mode;
unsigned st_nlink;
unsigned st_uid;
unsigned st_gid;
unsigned st_rdev;
unsigned int st_pad2[2];
unsigned int st_size;
unsigned int st_pad3; /* st_size, off_t expansion */
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 st_blksize;
unsigned int st_blocks;
char st_fstype[16];
unsigned int st_pad4[8]; /* expansion area */
};
# define DO_PRINTSTAT do_printstat_sol
# define STRUCT_STAT struct solstat
# define STAT_MAJOR(x) (((x) >> 18) & 0x3fff)
# define STAT_MINOR(x) ((x) & 0x3ffff)
# undef HAVE_STRUCT_STAT_ST_FLAGS
# undef HAVE_STRUCT_STAT_ST_FSTYPE
# undef HAVE_STRUCT_STAT_ST_GEN
# include "printstat.h"
#endif /* SPARC || SPARC64 */
static void
printstat(struct tcb *tcp, long addr)
{
struct stat statbuf;
#ifdef STAT32_PERSONALITY
if (current_personality == STAT32_PERSONALITY) {
struct stat32 statbuf;
if (!umove_or_printaddr(tcp, addr, &statbuf))
do_printstat32(tcp, &statbuf);
return;
}
#endif
#if defined(SPARC) || defined(SPARC64)
if (current_personality == 1) {
struct solstat statbuf;
if (!umove_or_printaddr(tcp, addr, &statbuf))
do_printstat_sol(tcp, &statbuf);
return;
}
#endif /* SPARC || SPARC64 */
if (!umove_or_printaddr(tcp, addr, &statbuf))
do_printstat(tcp, &statbuf);
}
SYS_FUNC(stat)
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printstat(tcp, tcp->u_arg[1]);
}
return 0;
}
SYS_FUNC(fstat)
{
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printstat(tcp, tcp->u_arg[1]);
}
return 0;
}
#if defined STAT32_PERSONALITY && !defined HAVE_STRUCT_STAT64
# if defined AARCH64 || defined X86_64 || defined X32
/*
* Linux x86_64 and x32 have unified `struct stat' but their i386 personality
* needs `struct stat64'.
* linux/arch/x86/include/uapi/asm/stat.h defines `struct stat64' only for i386.
*
* Similarly, aarch64 has a unified `struct stat' but its arm personality
* needs `struct stat64' (unlike x86, it 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 || defined X32
ATTRIBUTE_PACKED
# define STAT64_SIZE 96
# else
# define STAT64_SIZE 104
# endif
;
# define HAVE_STRUCT_STAT64 1
# else /* !(AARCH64 || X86_64 || X32) */
# warning FIXME: check whether struct stat64 definition is needed for this architecture!
# endif
#endif /* STAT32_PERSONALITY && !HAVE_STRUCT_STAT64 */
#ifdef HAVE_STRUCT_STAT64
# define DO_PRINTSTAT do_printstat64
# define STRUCT_STAT struct stat64
# undef HAVE_STRUCT_STAT_ST_FLAGS
# undef HAVE_STRUCT_STAT_ST_FSTYPE
# undef HAVE_STRUCT_STAT_ST_GEN
# include "printstat.h"
static void
printstat64(struct tcb *tcp, long addr)
{
struct stat64 statbuf;
# ifdef STAT64_SIZE
(void) sizeof(char[sizeof statbuf == STAT64_SIZE ? 1 : -1]);
# endif
# ifdef STAT32_PERSONALITY
if (current_personality != STAT32_PERSONALITY) {
printstat(tcp, addr);
return;
}
# endif /* STAT32_PERSONALITY */
if (!umove_or_printaddr(tcp, addr, &statbuf))
do_printstat64(tcp, &statbuf);
}
SYS_FUNC(stat64)
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printstat64(tcp, tcp->u_arg[1]);
}
return 0;
}
SYS_FUNC(fstat64)
{
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printstat64(tcp, tcp->u_arg[1]);
}
return 0;
}
#else
SYS_FUNC(stat64)
{
return sys_stat(tcp);
}
SYS_FUNC(fstat64)
{
return sys_fstat(tcp);
}
#endif /* HAVE_STRUCT_STAT64 */
SYS_FUNC(newfstatat)
{
if (entering(tcp)) {
print_dirfd(tcp, tcp->u_arg[0]);
printpath(tcp, tcp->u_arg[1]);
tprints(", ");
} else {
#if defined STAT32_PERSONALITY
if (current_personality == STAT32_PERSONALITY)
printstat64(tcp, tcp->u_arg[2]);
else
printstat(tcp, tcp->u_arg[2]);
#elif defined HAVE_STRUCT_STAT64
printstat64(tcp, tcp->u_arg[2]);
#else
printstat(tcp, tcp->u_arg[2]);
#endif /* STAT32_PERSONALITY || HAVE_STRUCT_STAT64 */
tprints(", ");
printflags(at_flags, tcp->u_arg[3], "AT_???");
}
return 0;
}
#if defined(HAVE_STRUCT___OLD_KERNEL_STAT)
static void
convertoldstat(const struct __old_kernel_stat *oldbuf, struct stat *newbuf)
{
memset(newbuf, 0, sizeof(*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;
}
static void
printoldstat(struct tcb *tcp, long addr)
{
struct __old_kernel_stat statbuf;
struct stat newstatbuf;
# if defined(SPARC) || defined(SPARC64)
if (current_personality == 1) {
struct solstat statbuf;
if (!umove_or_printaddr(tcp, addr, &statbuf))
do_printstat_sol(tcp, &statbuf);
return;
}
# endif
if (!umove_or_printaddr(tcp, addr, &statbuf)) {
convertoldstat(&statbuf, &newstatbuf);
do_printstat(tcp, &newstatbuf);
}
}
SYS_FUNC(oldstat)
{
if (entering(tcp)) {
printpath(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printoldstat(tcp, tcp->u_arg[1]);
}
return 0;
}
SYS_FUNC(oldfstat)
{
if (entering(tcp)) {
printfd(tcp, tcp->u_arg[0]);
tprints(", ");
} else {
printoldstat(tcp, tcp->u_arg[1]);
}
return 0;
}
#endif /* HAVE_STRUCT___OLD_KERNEL_STAT */
#if defined(SPARC) || defined(SPARC64)
SYS_FUNC(xstat)
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
printpath(tcp, tcp->u_arg[1]);
tprints(", ");
} else {
printstat(tcp, tcp->u_arg[2]);
}
return 0;
}
SYS_FUNC(fxstat)
{
if (entering(tcp)) {
tprintf("%ld, ", tcp->u_arg[0]);
printfd(tcp, tcp->u_arg[1]);
tprints(", ");
} else {
printstat(tcp, tcp->u_arg[2]);
}
return 0;
}
#endif /* SPARC || SPARC64 */

View File

@ -25,6 +25,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STRACE_FLOCK_H
#define STRACE_FLOCK_H
#include <linux/fcntl.h>
#if defined HAVE_STRUCT_FLOCK
@ -42,3 +45,5 @@ typedef struct __kernel_flock64 struct_kernel_flock64;
#else
# error struct flock64 definition not found in <linux/fcntl.h>
#endif
#endif /* !STRACE_FLOCK_H */

32
futex.c
View File

@ -30,10 +30,6 @@
#include "defs.h"
#ifdef HAVE_LINUX_FUTEX_H
# include <linux/futex.h>
#endif
#ifndef FUTEX_PRIVATE_FLAG
# define FUTEX_PRIVATE_FLAG 128
#endif
@ -59,32 +55,40 @@ SYS_FUNC(futex)
printaddr(uaddr);
tprints(", ");
printxval(futexops, op, "FUTEX_???");
tprintf(", %u", val);
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);
tprintf(", %#x", val3);
break;
case FUTEX_WAKE_BITSET:
tprintf(", %x", val3);
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(", {");
@ -92,23 +96,29 @@ SYS_FUNC(futex)
tprints("FUTEX_OP_OPARG_SHIFT|");
printxval(futexwakeops, (val3 >> 28) & 0x7, "FUTEX_OP_???");
tprintf(", %u, ", (val3 >> 12) & 0xfff);
if ((val3 >> 24) & 8)
tprints("FUTEX_OP_OPARG_SHIFT|");
printxval(futexwakecmps, (val3 >> 24) & 0x7, "FUTEX_OP_CMP_???");
printxval(futexwakecmps, (val3 >> 24) & 0xf, "FUTEX_OP_CMP_???");
tprintf(", %u}", 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(", %lx, %lx, %x", timeout, uaddr2, val3);
tprintf(", %u", val);
tprintf(", %#lx", timeout);
tprints(", ");
printaddr(uaddr2);
tprintf(", %#x", val3);
break;
}

View File

@ -25,8 +25,8 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef GCC_COMPAT_H_
#define GCC_COMPAT_H_
#ifndef STRACE_GCC_COMPAT_H
#define STRACE_GCC_COMPAT_H
#if defined __GNUC__ && defined __GNUC_MINOR__
# define GNUC_PREREQ(maj, min) \
@ -76,4 +76,4 @@
# define ATTRIBUTE_ALLOC_SIZE(args) /* empty */
#endif
#endif
#endif /* !STRACE_GCC_COMPAT_H */

View File

@ -1,7 +1,7 @@
#!/bin/sh -e
list="$(sed -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*\([[:alnum:]][^.]*\.c\)[[:space:]]*\\$/\1/p' Makefile.am |
xargs -r grep -lx '#[[:space:]]*include[[:space:]]\+MPERS_DEFS' |
list="$(sed -r -n '/^strace_SOURCES[[:space:]]*=/,/^[[:space:]]*# end of strace_SOURCES/ s/^[[:space:]]*([[:alnum:]][^.]*\.c)[[:space:]]*\\$/\1/p' Makefile.am |
xargs -r grep -Elx '#[[:space:]]*include[[:space:]]+MPERS_DEFS' |
tr '\n' ' ')"
cat > mpers.am <<EOF
@ -9,5 +9,5 @@ cat > mpers.am <<EOF
mpers_source_files = $list
EOF
sed -n 's/^#[[:space:]]*include[[:space:]]*"xlat\/\([^."]\+\)\.h".*/extern const struct xlat \1[];/p' \
sed -r -n 's/^#[[:space:]]*include[[:space:]]*"xlat\/([a-z][a-z_0-9]*)\.h".*/extern const struct xlat \1[];/p' \
$list > mpers_xlat.h

View File

@ -2,7 +2,7 @@
echo 'enum {'
echo 'SEN_printargs = 0,'
sed -n '/printargs/! s/.*SEN(\([^)]*\)).*/\1/p' |
sort -u |
sed -r -n '/printargs/! s/.*SEN\(([^)]+)\).*/\1/p' |
LC_COLLATE=C sort -u |
sed 's/.*/SEN_&,/'
echo '};'

View File

@ -1,28 +0,0 @@
#!/bin/sh
convert() {
sed -n '/^\(static \)\?const struct xlat '"$n"'\[\] = {$/,/^};$/{
s/^[[:space:]]*XLAT(\([^)]\+\)).*/\1/p
s/^[[:space:]]*{[[:space:]]*(\?\(1<<[^),[:space:]]\+\).*/\1/p
s/.*not NULL-terminated.*/#unterminated/p
s/^\([[:space:]]*{.*\)/\1/p
s/^\t*\( *[/*].*\)/\1/p}' "$f" >> xlat/"$n".in
sed -i '/^\(static \)\?const struct xlat '"$n"'\[\] = {$/,/^};$/c #include "xlat/'"$n"'.h"' "$f"
}
for f; do
for n in $(sed -n 's/^\(static \)\?const struct xlat \([a-z0-9_]\+\)\[\] = {$/\2/p' "$f"); do
case "$n" in
cacheflush_flags|struct_user_offsets) # skip
;;
ioprio_class|ioprio_who|mtd_mode_options|personality_options|syslog_action_type|ubi_volume_props|ubi_volume_types)
echo '#unconditional' > xlat/"$n".in
convert
;;
*)
> xlat/"$n".in
convert
;;
esac
done
done

29
io.c
View File

@ -85,13 +85,15 @@ print_iovec(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
case IOV_DECODE_STR:
if (len > c->data_size)
len = c->data_size;
c->data_size -= len;
if (c->data_size != (unsigned long) -1L)
c->data_size -= len;
printstr(tcp, iov[0], len);
break;
case IOV_DECODE_NETLINK:
if (len > c->data_size)
len = c->data_size;
c->data_size -= len;
if (c->data_size != (unsigned long) -1L)
c->data_size -= len;
decode_netlink(tcp, iov[0], iov[1]);
break;
default:
@ -150,17 +152,6 @@ SYS_FUNC(writev)
return RVAL_DECODED;
}
/* 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
SYS_FUNC(pread)
{
if (entering(tcp)) {
@ -172,7 +163,7 @@ SYS_FUNC(pread)
else
printstr(tcp, tcp->u_arg[1], tcp->u_rval);
tprintf(", %lu, ", tcp->u_arg[2]);
printllval(tcp, "%lld", PREAD_OFFSET_ARG);
printllval(tcp, "%lld", 3);
}
return 0;
}
@ -183,7 +174,7 @@ SYS_FUNC(pwrite)
tprints(", ");
printstr(tcp, tcp->u_arg[1], tcp->u_arg[2]);
tprintf(", %lu, ", tcp->u_arg[2]);
printllval(tcp, "%lld", PREAD_OFFSET_ARG);
printllval(tcp, "%lld", 3);
return RVAL_DECODED;
}
@ -212,8 +203,8 @@ print_lld_from_low_high_val(struct tcb *tcp, int arg)
# if SUPPORTED_PERSONALITIES > 1
if (current_personality == 1) {
tprintf("%lld",
(widen_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
| widen_to_ull(tcp->u_arg[arg]));
(zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
| zero_extend_signed_to_ull(tcp->u_arg[arg]));
} else
# endif
{
@ -221,8 +212,8 @@ print_lld_from_low_high_val(struct tcb *tcp, int arg)
}
#else /* SIZEOF_LONG_LONG > SIZEOF_LONG && !HAVE_STRUCT_TCB_EXT_ARG */
tprintf("%lld",
(widen_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
| widen_to_ull(tcp->u_arg[arg]));
(zero_extend_signed_to_ull(tcp->u_arg[arg + 1]) << sizeof(long) * 8)
| zero_extend_signed_to_ull(tcp->u_arg[arg]));
#endif
}

View File

@ -25,6 +25,9 @@
* 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 <sys/ipc.h>
#elif defined HAVE_LINUX_IPC_H
@ -40,3 +43,5 @@
#define PRINTCTL(flagset, arg, dflt) \
if ((arg) & IPC_64) tprints("IPC_64|"); \
printxval((flagset), (arg) &~ IPC_64, dflt)
#endif /* !STRACE_IPC_DEFS_H */

View File

@ -44,13 +44,15 @@
SYS_FUNC(msgget)
{
if (tcp->u_arg[0])
tprintf("%#lx, ", tcp->u_arg[0]);
const int key = (int) tcp->u_arg[0];
if (key)
tprintf("%#x", key);
else
tprints("IPC_PRIVATE, ");
tprints("IPC_PRIVATE");
tprints(", ");
if (printflags(resource_flags, tcp->u_arg[1] & ~0777, NULL) != 0)
tprints("|");
tprintf("%#lo", tcp->u_arg[1] & 0777);
print_numeric_umode_t(tcp->u_arg[1] & 0777);
return RVAL_DECODED;
}

View File

@ -67,7 +67,7 @@ print_msqid_ds(struct tcb *tcp, const long addr, int cmd)
printuid("uid=", msqid_ds.msg_perm.uid);
printuid(", gid=", msqid_ds.msg_perm.gid);
tprints(", mode=");
tprints(sprintmode(msqid_ds.msg_perm.mode));
print_numeric_umode_t(msqid_ds.msg_perm.mode);
if (cmd != IPC_STAT) {
tprints("}, ...}");
@ -97,7 +97,7 @@ print_msqid_ds(struct tcb *tcp, const long addr, int cmd)
SYS_FUNC(msgctl)
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
tprintf("%d, ", (int) tcp->u_arg[0]);
PRINTCTL(msgctl_flags, tcp->u_arg[1], "MSG_???");
tprints(", ");
} else {

View File

@ -57,7 +57,7 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
#endif
static void
tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned int count)
{
#if defined HAVE_SYS_SEM_H || defined HAVE_LINUX_SEM_H
struct sembuf sb;
@ -66,12 +66,12 @@ tprint_sembuf_array(struct tcb *tcp, const long addr, const unsigned long count)
#else
printaddr(addr);
#endif
tprintf(", %lu", count);
tprintf(", %u", count);
}
SYS_FUNC(semop)
{
tprintf("%lu, ", tcp->u_arg[0]);
tprintf("%d, ", (int) tcp->u_arg[0]);
if (indirect_ipccall(tcp)) {
tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
} else {
@ -82,7 +82,7 @@ SYS_FUNC(semop)
SYS_FUNC(semtimedop)
{
tprintf("%lu, ", tcp->u_arg[0]);
tprintf("%d, ", (int) tcp->u_arg[0]);
if (indirect_ipccall(tcp)) {
tprint_sembuf_array(tcp, tcp->u_arg[3], tcp->u_arg[1]);
tprints(", ");
@ -101,23 +101,28 @@ SYS_FUNC(semtimedop)
SYS_FUNC(semget)
{
if (tcp->u_arg[0])
tprintf("%#lx", tcp->u_arg[0]);
const int key = (int) tcp->u_arg[0];
if (key)
tprintf("%#x", key);
else
tprints("IPC_PRIVATE");
tprintf(", %lu, ", tcp->u_arg[1]);
tprintf(", %d, ", (int) tcp->u_arg[1]);
if (printflags(resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
tprints("|");
tprintf("%#lo", tcp->u_arg[2] & 0777);
print_numeric_umode_t(tcp->u_arg[2] & 0777);
return RVAL_DECODED;
}
SYS_FUNC(semctl)
{
tprintf("%lu, %lu, ", tcp->u_arg[0], tcp->u_arg[1]);
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)) {
if (indirect_ipccall(tcp)
#ifdef SPARC64
&& current_personality != 0
#endif
) {
printnum_ptr(tcp, tcp->u_arg[3]);
} else {
tprintf("%#lx", tcp->u_arg[3]);

View File

@ -43,21 +43,22 @@
SYS_FUNC(shmget)
{
if (tcp->u_arg[0])
tprintf("%#lx", tcp->u_arg[0]);
const int key = (int) tcp->u_arg[0];
if (key)
tprintf("%#x", key);
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);
print_numeric_umode_t(tcp->u_arg[2] & 0777);
return RVAL_DECODED;
}
SYS_FUNC(shmat)
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
tprintf("%d, ", (int) tcp->u_arg[0]);
if (indirect_ipccall(tcp)) {
printaddr(tcp->u_arg[3]);
tprints(", ");
@ -72,10 +73,14 @@ SYS_FUNC(shmat)
if (syserror(tcp))
return 0;
if (indirect_ipccall(tcp)) {
unsigned long raddr;
if (umove(tcp, tcp->u_arg[2], &raddr) < 0)
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 = raddr;
tcp->u_rval = (sizeof(u.r32) == current_wordsize)
? u.r32 : u.r64;
}
return RVAL_HEX;
}

View File

@ -67,7 +67,7 @@ print_shmid_ds(struct tcb *tcp, const long addr, int cmd)
printuid("uid=", shmid_ds.shm_perm.uid);
printuid(", gid=", shmid_ds.shm_perm.gid);
tprints(", mode=");
tprints(sprintmode(shmid_ds.shm_perm.mode));
print_numeric_umode_t(shmid_ds.shm_perm.mode);
if (cmd != IPC_STAT) {
tprints("}, ...}");
@ -97,7 +97,7 @@ print_shmid_ds(struct tcb *tcp, const long addr, int cmd)
SYS_FUNC(shmctl)
{
if (entering(tcp)) {
tprintf("%lu, ", tcp->u_arg[0]);
tprintf("%d, ", (int) tcp->u_arg[0]);
PRINTCTL(shmctl_flags, tcp->u_arg[1], "SHM_???");
tprints(", ");
} else {

View File

@ -26,8 +26,7 @@
*/
#ifndef STRACE_KERNEL_TYPES_H
# define STRACE_KERNEL_TYPES_H
#define STRACE_KERNEL_TYPES_H
# if defined HAVE___KERNEL_LONG_T && defined HAVE___KERNEL_ULONG_T
@ -55,4 +54,4 @@ typedef struct {
char d_name[1];
} kernel_dirent;
#endif
#endif /* !STRACE_KERNEL_TYPES_H */

159
keyctl.c
View File

@ -26,11 +26,18 @@
*/
#include "defs.h"
#include "kernel_types.h"
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)
{
@ -85,12 +92,13 @@ keyctl_get_keyring_id(struct tcb *tcp, key_serial_t id, int create)
}
static void
keyctl_update_key(struct tcb *tcp, key_serial_t id, long addr, long len)
keyctl_update_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr,
kernel_ulong_t len)
{
print_keyring_serial_number(id);
tprints(", ");
printstr(tcp, addr, len);
tprintf(", %lu", len);
tprintf(", %llu", zero_extend_signed_to_ull(len));
}
static void
@ -102,7 +110,8 @@ keyctl_handle_key_key(struct tcb *tcp, key_serial_t id1, key_serial_t id2)
}
static void
keyctl_read_key(struct tcb *tcp, key_serial_t id, long addr, long len)
keyctl_read_key(struct tcb *tcp, key_serial_t id, kernel_ulong_t addr,
kernel_ulong_t len, bool has_nul)
{
if (entering(tcp)) {
print_keyring_serial_number(id);
@ -111,17 +120,19 @@ keyctl_read_key(struct tcb *tcp, key_serial_t id, long addr, long len)
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));
}
}
static void
keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, long addr1,
long addr2, key_serial_t id2)
keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr1,
kernel_ulong_t addr2, key_serial_t id2)
{
print_keyring_serial_number(id1);
tprints(", ");
@ -133,31 +144,34 @@ keyctl_keyring_search(struct tcb *tcp, key_serial_t id1, long addr1,
}
static void
keyctl_chown_key(struct tcb *tcp, key_serial_t id, int user, int group)
keyctl_chown_key(struct tcb *tcp, key_serial_t id, unsigned user,
unsigned group)
{
print_keyring_serial_number(id);
tprintf(", %d, %d", user, group);
printuid(", ", user);
printuid(", ", group);
}
static void
keyctl_instantiate_key(struct tcb *tcp, key_serial_t id1, long addr,
long len, key_serial_t id2)
keyctl_instantiate_key(struct tcb *tcp, key_serial_t id1, kernel_ulong_t addr,
kernel_ulong_t len, key_serial_t id2)
{
print_keyring_serial_number(id1);
tprints(", ");
printstr(tcp, addr, len);
tprintf(", %lu, ", len);
tprintf(", %llu, ", zero_extend_signed_to_ull(len));
print_keyring_serial_number(id2);
}
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)
{
print_keyring_serial_number(id1);
tprints(", ");
tprint_iov(tcp, len, addr, IOV_DECODE_STR);
tprintf(", %lu, ", len);
tprintf(", %llu, ", zero_extend_signed_to_ull(len));
print_keyring_serial_number(id2);
}
@ -174,8 +188,16 @@ static void
keyctl_reject_key(struct tcb *tcp, key_serial_t id1, unsigned timeout,
unsigned error, key_serial_t id2)
{
const char *err_str = err_name(error);
print_keyring_serial_number(id1);
tprintf(", %u, %u, ", timeout, error);
tprintf(", %u, ", timeout);
if (err_str)
tprintf("%s, ", err_str);
else
tprintf("%u, ", error);
print_keyring_serial_number(id2);
}
@ -187,9 +209,10 @@ keyctl_set_timeout(struct tcb *tcp, key_serial_t id, unsigned timeout)
}
static void
keyctl_get_persistent(struct tcb *tcp, int uid, key_serial_t id)
keyctl_get_persistent(struct tcb *tcp, unsigned uid, key_serial_t id)
{
tprintf("%d, ", uid);
printuid("", uid);
tprints(", ");
print_keyring_serial_number(id);
}
@ -203,105 +226,145 @@ keyctl_setperm_key(struct tcb *tcp, key_serial_t id, uint32_t perm)
printflags(key_perms, perm, "KEY_???");
}
static void
print_dh_params(struct tcb *tcp, kernel_ulong_t addr)
{
struct keyctl_dh_params params;
if (umove_or_printaddr(tcp, addr, &params))
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 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(", ");
} 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;
printstr(tcp, buf, rval);
}
tprintf(", %llu", zero_extend_signed_to_ull(len));
}
}
#include "xlat/key_reqkeys.h"
#include "xlat/keyctl_commands.h"
SYS_FUNC(keyctl)
{
int cmd = tcp->u_arg[0];
unsigned long long arg2 = getarg_ull(tcp, 1);
unsigned long long arg3 = getarg_ull(tcp, 2);
unsigned long long arg4 = getarg_ull(tcp, 3);
unsigned long long arg5 = getarg_ull(tcp, 4);
if (entering(tcp)) {
printxval(keyctl_commands, cmd, "KEYCTL_???");
tprints(", ");
/*
* 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:
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:
printstr(tcp, tcp->u_arg[1], -1);
printstr(tcp, arg2, -1);
break;
case KEYCTL_UPDATE:
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:
print_keyring_serial_number(tcp->u_arg[1]);
print_keyring_serial_number(arg2);
break;
case KEYCTL_LINK:
case KEYCTL_UNLINK:
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:
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:
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:
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:
keyctl_setperm_key(tcp, tcp->u_arg[1], tcp->u_arg[2]);
keyctl_setperm_key(tcp, arg2, arg3);
break;
case KEYCTL_INSTANTIATE:
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:
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:
printxval(key_reqkeys, tcp->u_arg[1], "KEY_REQKEY_DEFL_???");
printxval(key_reqkeys, arg2, "KEY_REQKEY_DEFL_???");
break;
case KEYCTL_SET_TIMEOUT:
keyctl_set_timeout(tcp, tcp->u_arg[1], tcp->u_arg[2]);
keyctl_set_timeout(tcp, arg2, arg3);
break;
case KEYCTL_SESSION_TO_PARENT:
break;
case KEYCTL_REJECT:
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:
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:
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:
tprintf("%#lx, %#lx, %#lx, %#lx",
tcp->u_arg[1], tcp->u_arg[2],
tcp->u_arg[3], tcp->u_arg[4]);
tprintf("%#llx, %#llx, %#llx, %#llx", arg2, arg3, arg4, arg5);
break;
}

View File

@ -284,6 +284,7 @@
{ "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, 0x20 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
@ -392,10 +393,13 @@
{ "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 },
@ -683,6 +687,16 @@
{ "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 },
@ -969,7 +983,11 @@
{ "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 },
@ -1418,30 +1436,14 @@
{ "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_FILTER_PULSE", _IOC_READ, 0x690b, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_FILTER_SPACE", _IOC_READ, 0x690d, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_PULSE", _IOC_READ, 0x690a, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_SPACE", _IOC_READ, 0x690c, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_CARRIER", _IOC_READ, 0x6904, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_DUTY_CYCLE", _IOC_READ, 0x6906, 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_CARRIER", _IOC_READ, 0x6903, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_DUTY_CYCLE", _IOC_READ, 0x6905, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
{ "linux/lirc.h", "LIRC_NOTIFY_DECODE", _IOC_NONE, 0x6920, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_END", _IOC_NONE, 0x6922, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_START", _IOC_NONE, 0x6921, 0x00 },
{ "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_DUTY_CYCLE", _IOC_WRITE, 0x6916, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_DUTY_CYCLE_RANGE", _IOC_WRITE, 0x691e, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER", _IOC_WRITE, 0x691c, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_PULSE", _IOC_WRITE, 0x691a, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_SPACE", _IOC_WRITE, 0x691b, 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 },
@ -1553,19 +1555,19 @@
{ "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_fs.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 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/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 },
@ -1739,6 +1741,17 @@
{ "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 },
@ -2244,6 +2257,8 @@
{ "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 },
@ -2348,7 +2363,6 @@
{ "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/vsp1.h", "VIDIOC_VSP1_LUT_CONFIG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x400 },
{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
@ -2365,6 +2379,7 @@
{ "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 },
@ -2771,8 +2786,6 @@
{ "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 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_CREATE_FENCE", _IOC_READ|_IOC_WRITE, 0x5700, 0x28 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_INC", _IOC_WRITE, 0x5701, 0x04 },
{ "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 },
@ -2813,6 +2826,7 @@
{ "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 },

View File

@ -284,6 +284,7 @@
{ "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, 0x20 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
@ -392,10 +393,13 @@
{ "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 },
@ -683,6 +687,16 @@
{ "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 },
@ -969,7 +983,11 @@
{ "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 },
@ -1418,30 +1436,14 @@
{ "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_FILTER_PULSE", _IOC_READ, 0x690b, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_FILTER_SPACE", _IOC_READ, 0x690d, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_PULSE", _IOC_READ, 0x690a, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_SPACE", _IOC_READ, 0x690c, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_CARRIER", _IOC_READ, 0x6904, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_DUTY_CYCLE", _IOC_READ, 0x6906, 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_CARRIER", _IOC_READ, 0x6903, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_DUTY_CYCLE", _IOC_READ, 0x6905, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
{ "linux/lirc.h", "LIRC_NOTIFY_DECODE", _IOC_NONE, 0x6920, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_END", _IOC_NONE, 0x6922, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_START", _IOC_NONE, 0x6921, 0x00 },
{ "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_DUTY_CYCLE", _IOC_WRITE, 0x6916, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_DUTY_CYCLE_RANGE", _IOC_WRITE, 0x691e, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER", _IOC_WRITE, 0x691c, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_PULSE", _IOC_WRITE, 0x691a, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_SPACE", _IOC_WRITE, 0x691b, 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 },
@ -1553,19 +1555,19 @@
{ "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_fs.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 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/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 },
@ -1739,6 +1741,17 @@
{ "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 },
@ -2244,6 +2257,8 @@
{ "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 },
@ -2348,7 +2363,6 @@
{ "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/vsp1.h", "VIDIOC_VSP1_LUT_CONFIG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x400 },
{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
@ -2365,6 +2379,7 @@
{ "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 },
@ -2771,8 +2786,6 @@
{ "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 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_CREATE_FENCE", _IOC_READ|_IOC_WRITE, 0x5700, 0x28 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_INC", _IOC_WRITE, 0x5701, 0x04 },
{ "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 },
@ -2813,6 +2826,7 @@
{ "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 },

View File

@ -1,8 +1,8 @@
#ifndef sys_ARCH_mmap
# define sys_ARCH_mmap sys_mmap
#endif
[ 0] = { 2, 0, SEN(io_setup), "io_setup" },
[ 1] = { 1, 0, SEN(io_destroy), "io_destroy" },
[ 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" },
@ -80,7 +80,7 @@
[ 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), "fstatat64" },
[ 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" },

View File

@ -284,6 +284,7 @@
{ "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, 0x20 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
@ -392,10 +393,13 @@
{ "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 },
@ -683,6 +687,16 @@
{ "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 },
@ -969,7 +983,11 @@
{ "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 },
@ -1418,30 +1436,14 @@
{ "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_FILTER_PULSE", _IOC_READ, 0x690b, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_FILTER_SPACE", _IOC_READ, 0x690d, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_PULSE", _IOC_READ, 0x690a, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_SPACE", _IOC_READ, 0x690c, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_CARRIER", _IOC_READ, 0x6904, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_DUTY_CYCLE", _IOC_READ, 0x6906, 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_CARRIER", _IOC_READ, 0x6903, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_DUTY_CYCLE", _IOC_READ, 0x6905, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
{ "linux/lirc.h", "LIRC_NOTIFY_DECODE", _IOC_NONE, 0x6920, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_END", _IOC_NONE, 0x6922, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_START", _IOC_NONE, 0x6921, 0x00 },
{ "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_DUTY_CYCLE", _IOC_WRITE, 0x6916, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_DUTY_CYCLE_RANGE", _IOC_WRITE, 0x691e, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER", _IOC_WRITE, 0x691c, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_PULSE", _IOC_WRITE, 0x691a, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_SPACE", _IOC_WRITE, 0x691b, 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 },
@ -1553,19 +1555,19 @@
{ "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_fs.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 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/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 },
@ -1739,6 +1741,17 @@
{ "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 },
@ -2244,6 +2257,8 @@
{ "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 },
@ -2348,7 +2363,6 @@
{ "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/vsp1.h", "VIDIOC_VSP1_LUT_CONFIG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x400 },
{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
@ -2365,6 +2379,7 @@
{ "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 },
@ -2771,8 +2786,6 @@
{ "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 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_CREATE_FENCE", _IOC_READ|_IOC_WRITE, 0x5700, 0x28 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_INC", _IOC_WRITE, 0x5701, 0x04 },
{ "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 },
@ -2813,6 +2826,7 @@
{ "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 },

View File

@ -1,5 +1,5 @@
[ 0] = { 2, 0, SEN(io_setup), "io_setup" },
[ 1] = { 1, 0, SEN(io_destroy), "io_destroy" },
[ 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" },

View File

@ -361,8 +361,8 @@
[395] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
[396] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[397] = { 5, 0, SEN(tuxcall), "tuxcall" },
[398] = { 2, 0, SEN(io_setup), "io_setup" },
[399] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -417,7 +417,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -268,8 +268,8 @@
[240] = { 6, 0, SEN(futex), "futex" },
[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[243] = { 2, 0, SEN(io_setup), "io_setup" },
[244] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -351,7 +351,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -1,2 +1,52 @@
#include "kernel_types.h"
#include <asm/stat.h>
#ifndef STRACE_ASM_STAT_H
#define STRACE_ASM_STAT_H
# include "kernel_types.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 <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 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 */

View File

@ -222,8 +222,8 @@
[194] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[195] = { 2, 0, SEN(capget), "capget" },
[196] = { 2, 0, SEN(capset), "capset" },
[197] = { 2, 0, SEN(io_setup), "io_setup" },
[198] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -273,7 +273,7 @@
[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(newfstatat), "fstatat64" },
[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" },
@ -351,3 +351,5 @@
[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" },

View File

@ -270,8 +270,8 @@
[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, 0, SEN(io_setup), "io_setup" },
[246] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -325,7 +325,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -26,6 +26,9 @@
* 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
@ -156,3 +159,5 @@
#define sys_oldolduname printargs
#define sys_olduname printargs
#define sys_sysfs printargs
#endif /* !STRACE_LINUX_DUMMY_H */

View File

@ -1,6 +0,0 @@
#!/bin/sh
grep '^#define' dummy.h | cut -f2 | \
while read func; do
grep -q -F -- "${func}(" syscall.h && echo "Defined as macro and as func: $func"
done

View File

@ -217,8 +217,8 @@
[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, 0, SEN(io_setup), "io_setup" },
[216] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -282,7 +282,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -270,8 +270,8 @@
[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, 0, SEN(io_setup), "io_setup" },
[246] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -325,7 +325,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -254,8 +254,8 @@
[1235] = { 3, TS, SEN(tgkill), "tgkill" },
[1236] = { 1, TP|SE, SEN(exit), "exit_group" },
[1237] = { 3, 0, SEN(lookup_dcookie), "lookup_dcookie" },
[1238] = { 2, 0, SEN(io_setup), "io_setup" },
[1239] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

View File

@ -1,3 +1,6 @@
#ifndef STRACE_LINUX_INET_DIAG_H
#define STRACE_LINUX_INET_DIAG_H
#define TCPDIAG_GETSOCK 18
#define DCCPDIAG_GETSOCK 19
@ -36,3 +39,5 @@ struct inet_diag_msg {
uint32_t idiag_uid;
uint32_t idiag_inode;
};
#endif /* !STRACE_LINUX_INET_DIAG_H */

View File

@ -266,8 +266,8 @@
[238] = { 3, TM, SEN(madvise), "madvise" },
[239] = { 3, TD, SEN(fcntl64), "fcntl64" },
[240] = { 4, TD, SEN(readahead), "readahead" },
[241] = { 2, 0, SEN(io_setup), "io_setup" },
[242] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -318,7 +318,7 @@
[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), "fstatat64" },
[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" },

View File

@ -270,8 +270,8 @@
[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, 0, SEN(io_setup), "io_setup" },
[246] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -325,7 +325,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -6,5 +6,5 @@ dstdir="$1"; shift
for n in n32 n64 o32; do
in="$srcdir/syscallent-$n.h"
out="$dstdir/syscallent-$n-stub.h"
sed -n '/^#if/,/^#else/ {s/^\([^{]*{[^,]*,[^,]*,[[:space:]]*\)[^,[:space:]]\+,[[:space:]]*"\([^"]\+".*\)/\1SEN(printargs), "'$n'_\2/; s/^\[.*/&/p}' < "$in" > "$out"
sed -r -n '/^#if/,/^#else/ {s/^([^{]*\{[^,]*,[^,]*,[[:space:]]*)[^,[:space:]]+,[[:space:]]*"([^"]+".*)/\1SEN(printargs), "'$n':\2/; s/^\[.*/&/p}' < "$in" > "$out"
done

View File

@ -200,8 +200,8 @@
[6197] = { 3, 0, SEN(printargs), "cacheflush" },
[6198] = { 3, 0, SEN(printargs), "cachectl" },
[6199] = { 4, 0, SEN(sysmips), "sysmips" },
[6200] = { 2, 0, SEN(io_setup), "io_setup" },
[6201] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

View File

@ -200,8 +200,8 @@
[5197] = { 3, 0, SEN(printargs), "cacheflush" },
[5198] = { 3, 0, SEN(printargs), "cachectl" },
[5199] = { 4, 0, SEN(sysmips), "sysmips" },
[5200] = { 2, 0, SEN(io_setup), "io_setup" },
[5201] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

View File

@ -241,8 +241,8 @@
[4238] = { 6, 0, SEN(futex), "futex" },
[4239] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
[4240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[4241] = { 2, 0, SEN(io_setup), "io_setup" },
[4242] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -293,7 +293,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -1,3 +1,6 @@
#ifndef STRACE_LINUX_NETLINK_DIAG_H
#define STRACE_LINUX_NETLINK_DIAG_H
struct netlink_diag_req {
uint8_t sdiag_family;
uint8_t sdiag_protocol;
@ -22,3 +25,5 @@ struct netlink_diag_msg {
#define NDIAG_SHOW_MEMINFO 0x00000001
#define NDIAG_PROTO_ALL ((uint8_t) ~0)
#endif /* !STRACE_LINUX_NETLINK_DIAG_H */

View File

@ -253,8 +253,8 @@
[224] = { },
[225] = { 5, 0, SEN(printargs), "tuxcall" },
[226] = { 4, TD|TN, SEN(sendfile64), "sendfile64" },
[227] = { 2, 0, SEN(io_setup), "io_setup" },
[228] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -317,7 +317,7 @@
[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), "fstatat64" },
[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" },

View File

@ -1,2 +1,3 @@
#include "powerpc/arch_regs.c"
#undef ARCH_PC_REG
#define ARCH_PC_REG ppc_regs.nip

View File

@ -248,8 +248,8 @@
[224] = { },
[225] = { 5, 0, SEN(printargs), "tuxcall" },
[226] = { },
[227] = { 2, 0, SEN(io_setup), "io_setup" },
[228] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

3
linux/riscv/arch_regs.c Normal file
View File

@ -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

2
linux/riscv/errnoent1.h Normal file
View File

@ -0,0 +1,2 @@
/* RISC-V rv32 and rv64 */
#include "../errnoent.h"

10
linux/riscv/get_error.c Normal file
View File

@ -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;
}
}

7
linux/riscv/get_scno.c Normal file
View File

@ -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;
}

View File

@ -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;
}

View File

@ -0,0 +1 @@
/* Generated by ioctls_gen.sh from definitions found in $linux/arch/riscv/include/ tree. */

View File

@ -0,0 +1 @@
#include "ioctls_arch0.h"

View File

@ -0,0 +1 @@
#include "64/ioctls_inc.h"

View File

@ -0,0 +1 @@
#include "32/ioctls_inc.h"

2
linux/riscv/signalent1.h Normal file
View File

@ -0,0 +1,2 @@
/* RISC-V rv32 and rv64 */
#include "../signalent.h"

1
linux/riscv/syscallent.h Normal file
View File

@ -0,0 +1 @@
#include "64/syscallent.h"

View File

@ -0,0 +1 @@
#include "32/syscallent.h"

View File

@ -271,8 +271,8 @@
[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[241] = { 3, TS, SEN(tgkill), "tgkill" },
[242] = { },
[243] = { 2, 0, SEN(io_setup), "io_setup" },
[244] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -321,7 +321,7 @@
[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), "fstatat64" },
[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" },

View File

@ -1,2 +1 @@
#include "s390/arch_regs.c"
#define ARCH_PC_REG s390_regset.psw.addr

View File

@ -255,8 +255,8 @@
[240] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[241] = { 3, TS, SEN(tgkill), "tgkill" },
[242] = { },
[243] = { 2, 0, SEN(io_setup), "io_setup" },
[244] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

View File

@ -270,8 +270,8 @@
[241] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
[242] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[243 ... 244] = { },
[245] = { 2, 0, SEN(io_setup), "io_setup" },
[246] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -325,7 +325,7 @@
[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(newfstatat), "fstatat64" },
[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" },
@ -394,6 +394,20 @@
[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" },
#define SYS_socket_subcall 400
#include "subcall.h"

View File

@ -296,8 +296,8 @@
[269] = { 3, 0, SEN(sched_setaffinity), "sched_setaffinity" },
[270] = { 3, 0, SEN(sched_getaffinity), "sched_getaffinity" },
[271 ... 272] = { },
[273] = { 2, 0, SEN(io_setup), "io_setup" },
[274] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -323,7 +323,7 @@
[297] = { 3, TD, SEN(fstatfs64), "fstatfs64" },
[298] = { 3, TS, SEN(tgkill), "tgkill" },
[299] = { 2, TF, SEN(utimes), "utimes" },
[300] = { 4, TD, SEN(fadvise64), "fadvise64_64" },
[300] = { 4, TD, SEN(fadvise64_64), "fadvise64_64" },
[301] = { },
[302] = { 6, TM, SEN(mbind), "mbind" },
[303] = { 5, TM, SEN(get_mempolicy), "get_mempolicy" },
@ -351,7 +351,7 @@
[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(newfstatat), "fstatat64" },
[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" },
@ -403,6 +403,20 @@
[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"

View File

@ -1,6 +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 */

View File

@ -1,12 +1,22 @@
#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)
{
long fp = sparc_regs.u_regs[U_REG_FP] + sizeof(struct sparc_stackf);
long fp = sparc_regs.u_regs[U_REG_FP] +
SIZEOF_STRUCT_SPARC_STACKF + SIZEOF_STRUCT_PT_REGS;
struct {
struct pt_regs si_regs;
int si_mask;
void *fpu_save;
long insns[2] ATTRIBUTE_ALIGNED(8);
unsigned int mask;
char fpu_save[PERSONALITY_WORDSIZE];
char insns[PERSONALITY_WORDSIZE * 2] ATTRIBUTE_ALIGNED(8);
unsigned int extramask[NSIG / 8 / sizeof(int) - 1];
} frame;
@ -15,9 +25,13 @@ arch_sigreturn(struct tcb *tcp)
} else {
unsigned int mask[NSIG / 8 / sizeof(int)];
mask[0] = frame.si_mask;
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

View File

@ -266,8 +266,8 @@
[265] = { 1, 0, SEN(timer_delete), "timer_delete" },
[266] = { 3, 0, SEN(timer_create), "timer_create" },
[267] = { },
[268] = { 2, 0, SEN(io_setup), "io_setup" },
[269] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -287,7 +287,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -1,2 +1,3 @@
#include "sparc/arch_regs.c"
#undef ARCH_PC_REG
#define ARCH_PC_REG sparc_regs.tpc

View File

@ -1 +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);
}

View File

@ -12,11 +12,11 @@ arch_get_scno(struct tcb *tcp)
switch (trap) {
case 0x91d02010:
/* Linux/SPARC syscall trap. */
update_personality(tcp, 0);
update_personality(tcp, 1);
break;
case 0x91d0206d:
/* Linux/SPARC64 syscall trap. */
update_personality(tcp, 1);
update_personality(tcp, 0);
break;
}

View File

@ -1 +1,27 @@
#include "sparc/get_syscall_args.c"
/* 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 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) sparc_regs.u_regs[U_REG_O0 + 0];
tcp->u_arg[1] = (long) (uint32_t) sparc_regs.u_regs[U_REG_O0 + 1];
tcp->u_arg[2] = (long) (uint32_t) sparc_regs.u_regs[U_REG_O0 + 2];
tcp->u_arg[3] = (long) (uint32_t) sparc_regs.u_regs[U_REG_O0 + 3];
tcp->u_arg[4] = (long) (uint32_t) sparc_regs.u_regs[U_REG_O0 + 4];
tcp->u_arg[5] = (long) (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;
}

View File

@ -1 +1,129 @@
#include "sparc/ioctls_arch0.h"
/* 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 },

View File

@ -1,129 +1 @@
/* 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, 0x38 },
{ "asm/ioctls.h", "TCGETS2", _IOC_READ, 0x540c, 0x40 },
{ "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, 0x38 },
{ "asm/ioctls.h", "TCSETS2", _IOC_WRITE, 0x540d, 0x40 },
{ "asm/ioctls.h", "TCSETSF", _IOC_WRITE, 0x540b, 0x38 },
{ "asm/ioctls.h", "TCSETSF2", _IOC_WRITE, 0x540f, 0x40 },
{ "asm/ioctls.h", "TCSETSW", _IOC_WRITE, 0x540a, 0x38 },
{ "asm/ioctls.h", "TCSETSW2", _IOC_WRITE, 0x540e, 0x40 },
{ "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 },
#include "sparc/ioctls_arch0.h"

View File

@ -1 +1 @@
#include "sparc/ioctls_inc0.h"
#include "64/ioctls_inc.h"

View File

@ -1 +1 @@
#include "64/ioctls_inc.h"
#include "sparc/ioctls_inc0.h"

View File

@ -11,18 +11,18 @@
[ 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" },
[ 13] = { 3, TF, SEN(chown), "chown" },
[ 14] = { 3, TF, SEN(mknod), "mknod" },
[ 15] = { 2, TF, SEN(chmod), "chmod" },
[ 16] = { 3, TF, SEN(chown16), "lchown" },
[ 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(setuid16), "setuid" },
[ 24] = { 0, NF, SEN(getuid16), "getuid" },
[ 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" },
@ -43,11 +43,11 @@
[ 43] = { 1, 0, SEN(times), "times" },
[ 44] = { },
[ 45] = { 2, TF, SEN(umount2), "umount2" },
[ 46] = { 1, 0, SEN(setgid16), "setgid" },
[ 47] = { 0, NF, SEN(getgid16), "getgid" },
[ 46] = { 1, 0, SEN(setgid), "setgid" },
[ 47] = { 0, NF, SEN(getgid), "getgid" },
[ 48] = { 2, TS, SEN(signal), "signal" },
[ 49] = { 0, NF, SEN(geteuid16), "geteuid" },
[ 50] = { 0, NF, SEN(getegid16), "getegid" },
[ 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] = { },
@ -75,8 +75,8 @@
[ 76] = { 0, 0, SEN(vhangup), "vhangup" },
[ 77] = { },
[ 78] = { 3, TM, SEN(mincore), "mincore" },
[ 79] = { 2, 0, SEN(getgroups16), "getgroups" },
[ 80] = { 2, 0, SEN(setgroups16), "setgroups" },
[ 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" },
@ -119,11 +119,11 @@
[120] = { 3, TD, SEN(readv), "readv" },
[121] = { 3, TD, SEN(writev), "writev" },
[122] = { 2, 0, SEN(settimeofday), "settimeofday" },
[123] = { 3, TD, SEN(fchown16), "fchown" },
[123] = { 3, TD, SEN(fchown), "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" },
[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" },
@ -206,7 +206,7 @@
[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), "fadvise64_64" },
[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" },
@ -224,8 +224,8 @@
[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" },
[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" },
@ -264,8 +264,8 @@
[265] = { 1, 0, SEN(timer_delete), "timer_delete" },
[266] = { 3, 0, SEN(timer_create), "timer_create" },
[267] = { },
[268] = { 2, 0, SEN(io_setup), "io_setup" },
[269] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -285,7 +285,7 @@
[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(newfstatat), "fstatat64" },
[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" },

View File

@ -1,3 +1 @@
#define sys_mmap_4koff sys_mmap_pgoff
#include "../sparc/syscallent.h"
#undef sys_mmap_4koff

View File

@ -31,7 +31,6 @@
#define IS TRACE_INDIRECT_SUBCALL
[SYS_socket_subcall + 0] = { 6, 0, SEN(printargs), "socket_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" },
@ -56,27 +55,14 @@
#define SYS_socket_nsubcalls 21
#define SYS_ipc_subcall ((SYS_socket_subcall) + (SYS_socket_nsubcalls))
[SYS_ipc_subcall + 0] = { 6, 0, SEN(printargs), "ipc_subcall" },
[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 + 5] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 6] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 7] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 8] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 9] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 10] = { 6, 0, SEN(printargs), "ipc_subcall" },
[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 + 15] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 16] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 17] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 18] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 19] = { 6, 0, SEN(printargs), "ipc_subcall" },
[SYS_ipc_subcall + 20] = { 6, 0, SEN(printargs), "ipc_subcall" },
[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" },

View File

@ -26,6 +26,9 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef STRACE_LINUX_SYSCALL_H
#define STRACE_LINUX_SYSCALL_H
#include "dummy.h"
#include "sys_func.h"
#include "sen.h"
@ -42,3 +45,5 @@ extern SYS_FUNC(setresuid16);
extern SYS_FUNC(setreuid16);
extern SYS_FUNC(setuid16);
#endif
#endif /* !STRACE_LINUX_SYSCALL_H */

View File

@ -1,3 +1,6 @@
#ifndef STRACE_LINUX_UNIX_DIAG_H
#define STRACE_LINUX_UNIX_DIAG_H
struct unix_diag_req {
uint8_t sdiag_family;
uint8_t sdiag_protocol;
@ -22,3 +25,5 @@ struct unix_diag_msg {
#define UNIX_DIAG_NAME 0
#define UNIX_DIAG_PEER 2
#endif /* !STRACE_LINUX_UNIX_DIAG_H */

View File

@ -1,2 +1 @@
#include "x86_64/arch_regs.c"
#define ARCH_PC_REG (x86_io.iov_len == sizeof(i386_regs) ? i386_regs.eip : x86_64_regs.rip)

View File

@ -1,47 +1 @@
/*
* This is a replacement for x32 <asm/stat.h> which
* appears to be wrong in older kernel headers.
*/
#ifndef STRACE_ASM_STAT_H
# define STRACE_ASM_STAT_H
# include "kernel_types.h"
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];
};
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;
};
#endif /* !STRACE_ASM_STAT_H */
#include "x86_64/asm_stat.h"

View File

@ -284,6 +284,7 @@
{ "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, 0x20 },
{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
@ -392,10 +393,13 @@
{ "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 },
@ -683,6 +687,16 @@
{ "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 },
@ -969,7 +983,11 @@
{ "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 },
@ -1418,30 +1436,14 @@
{ "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_FILTER_PULSE", _IOC_READ, 0x690b, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_FILTER_SPACE", _IOC_READ, 0x690d, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MAX_TIMEOUT", _IOC_READ, 0x6909, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_PULSE", _IOC_READ, 0x690a, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_FILTER_SPACE", _IOC_READ, 0x690c, 0x04 },
{ "linux/lirc.h", "LIRC_GET_MIN_TIMEOUT", _IOC_READ, 0x6908, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_CARRIER", _IOC_READ, 0x6904, 0x04 },
{ "linux/lirc.h", "LIRC_GET_REC_DUTY_CYCLE", _IOC_READ, 0x6906, 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_CARRIER", _IOC_READ, 0x6903, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_DUTY_CYCLE", _IOC_READ, 0x6905, 0x04 },
{ "linux/lirc.h", "LIRC_GET_SEND_MODE", _IOC_READ, 0x6901, 0x04 },
{ "linux/lirc.h", "LIRC_NOTIFY_DECODE", _IOC_NONE, 0x6920, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_END", _IOC_NONE, 0x6922, 0x00 },
{ "linux/lirc.h", "LIRC_SETUP_START", _IOC_NONE, 0x6921, 0x00 },
{ "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_DUTY_CYCLE", _IOC_WRITE, 0x6916, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_DUTY_CYCLE_RANGE", _IOC_WRITE, 0x691e, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER", _IOC_WRITE, 0x691c, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_PULSE", _IOC_WRITE, 0x691a, 0x04 },
{ "linux/lirc.h", "LIRC_SET_REC_FILTER_SPACE", _IOC_WRITE, 0x691b, 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 },
@ -1553,19 +1555,19 @@
{ "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_fs.h", "NILFS_IOCTL_CHANGE_CPMODE", _IOC_WRITE, 0x6e80, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_CLEAN_SEGMENTS", _IOC_WRITE, 0x6e88, 0x78 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_DELETE_CHECKPOINT", _IOC_WRITE, 0x6e81, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_BDESCS", _IOC_READ|_IOC_WRITE, 0x6e87, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPINFO", _IOC_READ, 0x6e82, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_CPSTAT", _IOC_READ, 0x6e83, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUINFO", _IOC_READ, 0x6e84, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_SUSTAT", _IOC_READ, 0x6e85, 0x30 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_GET_VINFO", _IOC_READ|_IOC_WRITE, 0x6e86, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_RESIZE", _IOC_WRITE, 0x6e8b, 0x08 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_ALLOC_RANGE", _IOC_WRITE, 0x6e8c, 0x10 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SET_SUINFO", _IOC_WRITE, 0x6e8d, 0x18 },
{ "linux/nilfs2_fs.h", "NILFS_IOCTL_SYNC", _IOC_READ, 0x6e8a, 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/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 },
@ -1739,6 +1741,17 @@
{ "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 },
@ -2244,6 +2257,8 @@
{ "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 },
@ -2348,7 +2363,6 @@
{ "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/vsp1.h", "VIDIOC_VSP1_LUT_CONFIG", _IOC_READ|_IOC_WRITE, 0x56c1, 0x400 },
{ "linux/vt.h", "VT_ACTIVATE", 0, 0x5606, 0 },
{ "linux/vt.h", "VT_DISALLOCATE", 0, 0x5608, 0 },
{ "linux/vt.h", "VT_GETHIFONTMASK", 0, 0x560D, 0 },
@ -2365,6 +2379,7 @@
{ "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 },
@ -2771,8 +2786,6 @@
{ "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 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_CREATE_FENCE", _IOC_READ|_IOC_WRITE, 0x5700, 0x28 },
{ "staging/android/sw_sync.h", "SW_SYNC_IOC_INC", _IOC_WRITE, 0x5701, 0x04 },
{ "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 },
@ -2813,6 +2826,7 @@
{ "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 },

View File

@ -204,8 +204,8 @@
[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, 0, SEN(printargs), "64:io_setup" },
[207] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },
@ -219,7 +219,7 @@
[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_64), "fadvise64" },
[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" },
@ -363,6 +363,6 @@
[540] = { 6, 0, SEN(process_vm_writev), "process_vm_writev" },
[541] = { 5, TN, SEN(setsockopt), "setsockopt" },
[542] = { 5, TN, SEN(getsockopt), "getsockopt" },
[543] = { 2, 0, SEN(io_setup), "io_setup" },
[543] = { 2, TM, SEN(io_setup), "io_setup" },
[544] = { 3, 0, SEN(io_submit), "io_submit" },
[545] = { 5, TD|TF|TP|SE|SI, SEN(execveat), "execveat", },

39
linux/x86_64/asm_stat.h Normal file
View File

@ -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 <asm/stat.h> 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 */

View File

@ -204,8 +204,8 @@
[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, 0, SEN(io_setup), "io_setup" },
[207] = { 1, 0, SEN(io_destroy), "io_destroy" },
[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" },

Some files were not shown because too many files have changed in this diff Show More