Commit Graph

260 Commits

Author SHA1 Message Date
9beaf2c3d3 Move all gl_WARN_ADD calls to a separate m4 macro
This is going to be needed for the upcoming AX_PROG_CC_FOR_BUILD
change.

* configure.ac: Call st_WARN_CFLAGS before AX_PROG_CC_FOR_BUILD.
Move all gl_WARN_ADD calls ...
* m4/st_warn_cflags.m4: ... here.
2016-12-07 10:59:52 +00:00
5c20f4aac4 tests: add valgrind support to "make check"
* m4/ax_valgrind_check.m4: Import from the autoconf-archive package.
* configure.ac: Invoke AX_VALGRIND_CHECK.
* valgrind.supp: Move to tests/strace.supp.
* Makefile.am (EXTRA_DIST): Remove valgrind.supp.
* tests/Makefile.am: Add @VALGRIND_CHECK_RULES@.
(VALGRIND_FLAGS, VALGRIND_SUPPRESSIONS_FILES): New variables.
(EXTRA_DIST): Add strace.supp.
* tests/init.sh: Add valgrind command prefix to $STRACE when appropriate.
2016-12-06 16:20:54 +00:00
Mikulas Patocka
a507a0bb77 Add support for decoding of DM_* ioctl commands
* dm.c: New file.
* xlat/dm_flags.in: Likewise.
* Makefile.am (strace_SOURCES): Add dm.c.
* configure.ac (AC_CHECK_HEADERS): Add linux/dm-ioctl.h.
* defs.h (dm_ioctl): New prototype.
* ioctl.c (ioctl_decode) [HAVE_LINUX_DM_IOCTL_H]: Call dm_ioctl
for 0xfd ioctl type.
* tests/ioctl_dm.c: New file.
* tests/ioctl_dm-v.c: Likewise.
* tests/ioctl_dm.test: New test.
* tests/ioctl_dm-v.test: Likewise.
* tests/.gitignore: Add ioctl_dm and ioctl_dm-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_dm.test and ioctl_dm-v.test.

Co-authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
2016-11-10 22:44:49 +03:00
Eugene Syromyatnikov
015aee943e tests: add tests for perf_event_attr structure decoding in perf_event_open
* configure.ac: Add checks for presence of various fields of struct
perf_event_attr defined in kernel headers.
* tests/perf_event_open.c: New file.
* tests/perf_event_open_unabbrev.c: Likewise.
* tests/perf_event_open.test: New test.
* tests/perf_event_open_unabbrev.test: Likewise.
* tests/.gitignore: Add perf_event_open, perf_event_open_unabbrev.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add perf_event_open.test, perf_event_open_unabbrev.test.
2016-10-31 11:29:20 +03:00
Eugene Syromyatnikov
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
Eugene Syromyatnikov
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
Eugene Syromyatnikov
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
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
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
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
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
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
Richard W.M. Jones
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
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
James Cowgill
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
70495eb3ef Remove configure checks for recvmmsg and sendmmsg
* configure.ac (AC_CHECK_FUNCS): Remove recvmmsg and sendmmsg.
2016-07-19 17:45:06 +00:00
891855edd9 tests: check decoding of accept4 syscall
* configure.ac (AC_CHECK_FUNCS): Add accept4.
* tests/accept4.c: New file.
* tests/accept4.test: New test.
* tests/.gitignore: Add accept4.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add accept4.test.
2016-07-12 14:42:30 +00:00
bf2698a6b8 msghdr.c: limit output when printing excessively large messages
Limit output of struct msghdr.msg_control when
struct msghdr.msg_controllen is greater than the maximum ancillary
buffer size specified in /proc/sys/net/core/optmem_max file.

* configure.ac (AC_CHECK_FUNCS): Add open64.
* defs.h (read_int_from_file): New prototype.
* util.c (read_int_from_file): New function.
* msghdr.c (get_optmem_max): New function based on read_int_from_file.
(decode_msg_control): Use it to check control_len argument.
* tests/msg_control.c (test_big_len): New function.
(main): Use it to test printing of excessively large messages.
2016-07-03 22:15:45 +00:00
cf0ef0852c Assume that libc provides struct msghdr.msg_control
* configure.ac (AC_CHECK_MEMBERS): Remove struct msghdr.msg_control.
* net.c (do_msghdr): Remove HAVE_STRUCT_MSGHDR_MSG_CONTROL check.
2016-06-26 23:56:59 +00:00
0a3d0e5f49 Assume that libc provides struct sockaddr_in6.sin6_scope_id
* configure.ac (AC_CHECK_MEMBERS): Remove
struct sockaddr_in6.sin6_scope_id.
* net.c (print_sockaddr_data_in6): Remove
HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID check.
2016-06-22 23:15:54 +00:00
b5f1fd926a Assume that libc provides inet_ntop and inet_pton
* configure.ac (AC_CHECK_FUNCS): Remove inet_ntop and inet_pton.
* net.c (sockaddr_buf_t, print_sockaddr, print_mreq6): Remove
HAVE_INET_NTOP checks.
* tests/ip_mreq.c: Remove HAVE_INET_PTON check.
2016-06-21 16:44:50 +00:00
ebda41a44a Cleanup netipx/ipx.h availability check
* configure.ac (AC_CHECK_HEADERS): Add netipx/ipx.h.
* net.c: Check for HAVE_NETIPX_IPX_H instead of __GLIBC__.
2016-06-19 22:02:45 +00:00
7c0e8875a4 configure.ac: fix checks for btrfs specific structures
* configure.ac (AC_CHECK_MEMBERS): Fix typo in the check for
struct btrfs_ioctl_defrag_range_args.start and
struct btrfs_ioctl_search_args_v2.buf_size.
2016-06-17 01:06:33 +00:00
a8d467e7a2 configure.ac: do not check for linux/in6.h
The last user of <linux/in6.h> was removed by commit v4.9-252-gf362a33.

* configure.ac (AC_CHECK_HEADERS): Remove linux/in6.h.
2016-06-16 01:00:24 +00:00
4f689a1407 net.c: include <linux/if_packet.h> unconditionally
* configure.ac (AC_CHECK_HEADERS): Remove linux/if_packet.h.
* net.c: Include <linux/if_packet.h> unconditionally.
2016-06-16 01:00:24 +00:00
d06010b3c4 net.c: include <linux/icmp.h> unconditionally
* configure.ac (AC_CHECK_HEADERS): Remove linux/icmp.h.
* net.c: Follow the example of tests/net-icmp_filter.c and include
<linux/icmp.h> unconditionally.
2016-06-16 01:00:23 +00:00
b10ee4e0eb net.c: include <linux/netlink.h> unconditionally
* configure.ac (AC_CHECK_HEADERS): Remove linux/netlink.h.
* net.c: Follow the example of socketutils.c and include
<linux/netlink.h> unconditionally.
2016-06-14 13:53:47 +00:00
Elvira Khabirova
dc427d50d9 Turn on more compiler warnings
* configure.ac (gl_WARN_ADD): Add -Wempty-body, -Wformat-security,
-Wignored-qualifiers, -Winit-self, -Wlogical-op,
-Wmissing-parameter-type, -Wnested-externs, -Wold-style-declaration,
-Wold-style-definition, -Wtype-limits.
2016-06-14 15:48:33 +00:00
2afa76e29a make-dist: generate strace-*.tar.gz, strace.dsc, and strace.spec
Change make-dist to generate strace-*.tar.gz, strace.dsc,
and strace.spec in addition to strace-*.tar.xz.

* configure.ac (AM_INIT_AUTOMAKE): Remove no-dist-gzip.
* make-dsc: New file.
* make-dist: Use it.
* .gitignore: Add strace-*.tar.gz, strace.dsc, and strace.spec.
2016-06-08 09:28:25 +00:00
669efd8678 Parametrize debian/changelog
* configure.ac (CHANGELOGTIME): Rename to RPM_CHANGELOGTIME.
(DEB_CHANGELOGTIME): New variable.
(AC_CONFIG_FILES): Add debian/changelog.
* strace.spec.in: Rename CHANGELOGTIME to RPM_CHANGELOGTIME.
* debian/changelog: Rename to ...
* debian/changelog.in: ... this file.  Add parametrized entry.
* debian/.gitignore: New file.
2016-06-08 09:28:21 +00:00
83ed8fb33c git-version-gen: replace '-' with '.' in generated version
* git-version-gen: Replace '-' with '.' so version conforms to policies
* configure.ac (SPEC_VERSION): Remove.
* strace.spec.in: Replace SPEC_VERSION with PACKAGE_VERSION.
Remove %srcname.
2016-06-08 00:27:22 +00:00
e2b3df2501 Parametrize strace.spec
* configure.ac (SPEC_VERSION, CHANGELOGTIME): Define.
(AC_CONFIG_FILES): Add strace.spec.
* strace.spec: Rename to ...
* strace.spec.in: ... this file.  Parametrize Version, srcname,
and the last %changelog entry.  Initialize .tarball-version file.
2016-06-07 18:16:41 +00:00
900503c90d Do not check for old sysctl enums
Assume that sysctl enums defined since linux v2.6 are always defined,
with a signle exception: check for CTL_PROC which definition was removed
in v2.6.18 and restored later in v2.6.23.

* configure.ac (AC_CHECK_DECLS): Remove old constants.
* xlat/sysctl_kern.in: Mark constants older than KERN_PRINTK_RATELIMIT
as unconditional.
* xlat/sysctl_net.in: Mark constants older than NET_LLC
as unconditional.
* xlat/sysctl_net_core.in: Mark constants older than NET_CORE_BUDGET
as unconditional.
* xlat/sysctl_net_ipv4.in: Mark constants older than
NET_IPV4_IGMP_MAX_MSF as unconditional.
* xlat/sysctl_net_ipv4_conf.in: Mark constants older than
NET_IPV4_CONF_FORCE_IGMP_VERSION as unconditional.
* xlat/sysctl_net_ipv4_route.in: Mark constants older than
NET_IPV4_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
* xlat/sysctl_net_ipv6.in: Mark constants older than
NET_IPV6_MLD_MAX_MSF as unconditional.
* xlat/sysctl_net_ipv6_route.in: Mark constants older than
NET_IPV6_ROUTE_GC_MIN_INTERVAL_MS as unconditional.
* xlat/sysctl_net_unix.in: Mark all constants as unconditional.
* xlat/sysctl_root.in: Mark constants older than CTL_ARLAN
as unconditional.
* xlat/sysctl_vm.in: Mark constants older than VM_MAX_MAP_COUNT
as unconditional.
2016-06-06 18:07:04 +00:00
799b22a27d tests: check decoding of BLK* ioctls
* configure.ac (AC_CHECK_TYPES): Add struct blk_user_trace_setup.
* tests/ioctl_block.c: New file.
* tests/ioctl_block.test: New test.
* tests/.gitignore: Add ioctl_block.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add ioctl_block.test.
2016-05-26 14:44:13 +00:00
c5253077d8 file_ioctl.c: fix build on systems without <linux/fiemap.h>
* configure.ac (AC_CHECK_HEADERS): Add linux/fiemap.h.
* file_ioctl.c: Do not include <linux/fiemap.h> and xlat/fiemap_*.h
if [!HAVE_LINUX_FIEMAP_H].
(file_ioctl): Do not parse FS_IOC_FIEMAP if [!HAVE_LINUX_FIEMAP_H].
2016-05-24 14:52:27 +00:00
Jeff Mahoney
8cc6962216 ioctl: add decoding support for btrfs ioctls
* btrfs.c: New file.
* file_ioctl.c: Likewise.
* Makefile.am (strace_SOURCES): Add them.
* configure.ac (AC_CHECK_HEADERS): Add linux/btrfs.h.
(AC_CHECK_MEMBERS): Add struct btrfs_ioctl_feature_flags.compat_flags,
struct btrfs_ioctl_fs_info_args.nodesize,
struct btrfs_ioctl_defrag_range_args.start,
and struct btrfs_ioctl_search_args_v2.buf_size.
(AC_CHECK_DECLS): Add BTRFS_COMPRESS_* enums.
* defs.h (btrfs_ioctl, file_ioctl): New prototypes.
* ioctl.c (ioctl_decode) [HAVE_LINUX_BTRFS_H]: Use btrfs_ioctl.
* xlat/btrfs_balance_args.in: New file.
* xlat/btrfs_balance_ctl_cmds.in: Likewise.
* xlat/btrfs_balance_flags.in: Likewise.
* xlat/btrfs_balance_state.in: Likewise.
* xlat/btrfs_compress_types.in: Likewise.
* xlat/btrfs_defrag_flags.in: Likewise.
* xlat/btrfs_dev_replace_cmds.in: Likewise.
* xlat/btrfs_dev_replace_results.in: Likewise.
* xlat/btrfs_dev_replace_state.in: Likewise.
* xlat/btrfs_dev_stats_flags.in: Likewise.
* xlat/btrfs_dev_stats_values.in: Likewise.
* xlat/btrfs_features_compat.in: Likewise.
* xlat/btrfs_features_compat_ro.in: Likewise.
* xlat/btrfs_features_incompat.in: Likewise.
* xlat/btrfs_key_types.in: Likewise.
* xlat/btrfs_qgroup_ctl_cmds.in: Likewise.
* xlat/btrfs_qgroup_inherit_flags.in: Likewise.
* xlat/btrfs_qgroup_limit_flags.in: Likewise.
* xlat/btrfs_qgroup_status_flags.in: Likewise.
* xlat/btrfs_scrub_flags.in: Likewise.
* xlat/btrfs_send_flags.in: Likewise.
* xlat/btrfs_snap_flags_v2.in: Likewise.
* xlat/btrfs_space_info_flags.in: Likewise.
* xlat/btrfs_tree_objectids.in: Likewise.
2016-05-24 14:52:27 +00:00
a8443f8695 v4l2: fix build with old kernel headers
Prior to v2.6.25-rc3, <linux/videodev2.h> didn't include all
required headers, resulting to omission of V4L2_* constants.

This issue doesn't arise in v4l2.c and tests/ioctl_v4l2.c files
because they already include all necessary headers themselves.

* configure.ac (AC_CHECK_DECLS): Include <sys/time.h>, <linux/ioctl.h>,
and <linux/types.h> before <linux/videodev2.h>.
2016-05-14 00:36:27 +00:00
3cc989e7fc configure.ac: do not check for sys/ioctl.h and ioctls.h
Since sys/ioctl.h is included unconditionally when needed
and ioctls.h doesn't exist, these checks are redundant.

* configure.ac (AC_CHECK_HEADERS): Remove ioctls.h and sys/ioctl.h.
2016-05-13 22:09:40 +00:00
Dr. David Alan Gilbert
5d1216a56b Decode UFFDIO_* ioctls
Decode the ioctls associated with the userfaultfd fd.
Note that they tend to read from and also return result in it's data
structure.

* configure.ac (AC_CHECK_HEADERS): Add linux/userfaultfd.h.
* userfaultfd.c [HAVE_LINUX_USERFAULTFD_H]: Add ioctl decoder.
* defs.h (uffdio_ioctl): New prototype.
* ioctl.c (ioctl_decode) [HAVE_LINUX_USERFAULTFD_H]: Wire in
uffdio_ioctl.
* xlat/uffd_*.in: Create flag xlat for all the IOCTLs.
2016-05-10 10:54:54 +00:00
6d44012cb5 Assume that sys/epoll.h exists
This header file was added in glibc-2.3.2,
so it's safe to assume its availability.

* configure.ac (AC_CHECK_HEADERS): Remove sys/epoll.h.
* epoll.c: Include <sys/epoll.h> unconditionally.
Compile [HAVE_SYS_EPOLL_H] code unconditionally.
* tests/epoll_ctl.c: Do not check for HAVE_SYS_EPOLL_H.
* tests/epoll_wait.c: Likewise.
2016-05-09 21:46:17 +00:00
67c2f67410 Fix decoding of statfs family syscalls
Fix decoders of fstatfs, fstatfs64, statfs, and statfs64 syscalls
by rewriting them using mpers infrastructure.

* fetch_struct_statfs.c: New file.
* fstatfs.c: Likewise.
* fstatfs64.c: Likewise.
* print_statfs.c: Likewise.
* statfs.h: Likewise.
* statfs64.c: Likewise.
* statfs.c: Remove everything except SYS_FUNC(statfs).
* configure.ac: Remove the check for struct statfs64 in <sys/vfs.h>.
Add checks for struct statfs and struct statfs64 in <asm/statfs.h>.
Add checks for f_frsize and f_flags members of these structures.
* defs.h (struct strace_statfs): New forward declaration.
(print_struct_statfs, print_struct_statfs64): New prototypes.
* Makefile.am (libstrace_a_SOURCES): Add fstatfs.c, fstatfs64.c,
statfs.c, and statfs64.c.
(strace_SOURCES): Add fetch_struct_statfs.c, print_statfs.c,
and statfs.h.
* NEWS: Mention this fix.
* tests/fstatfs.c: New file.
* tests/fstatfs64.c: Likewise.
* tests/statfs64.c: Likewise.
* tests/xstatfs.c: Likewise.
* tests/xstatfs64.c: Likewise.
* tests/xstatfsx.c: Likewise.
* tests/fstatfs.test: New test.
* tests/fstatfs64.test: Likewise.
* tests/statfs64.test: Likewise.
* tests/statfs.c: Rewrite using xstatfs.c.
* tests/statfs.test: Update.
* tests/.gitignore: Add fstatfs, fstatfs64, and statfs64.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add  fstatfs.test, fstatfs64.test, and statfs64.test.
(EXTRA_DIST): Add xstatfs.c, xstatfs64.c, and xstatfsx.c.
2016-04-26 01:35:31 +00:00
5b2d257839 tests: add sync_file_range.test and sync_file_range2.test
* configure.ac (AC_CHECK_FUNCS): Add sync_file_range.
* tests/sync_file_range.c: New file.
* tests/sync_file_range2.c: Likewise.
* tests/sync_file_range.test: New test.
* tests/sync_file_range2.test: Likewise.
* tests/.gitignore: Add sync_file_range and sync_file_range2.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(DECODER_TESTS): Add sync_file_range.test and sync_file_range2.test.
2016-04-06 00:02:08 +00:00