]> granicus.if.org Git - strace/log
strace
8 years agoFix printing of negative offsets in splice syscall
Dmitry V. Levin [Sat, 13 Feb 2016 22:31:30 +0000 (22:31 +0000)]
Fix printing of negative offsets in splice syscall

* io.c (SYS_FUNC(splice)): Use PRId64 instead of PRIu64 for printing
offsets.
* tests/splice.c: New file.
* tests/splice.test: New test.
* tests/.gitignore: Add splice.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add splice.test.

8 years agoImplement copy_file_range syscall decoding
Dmitry V. Levin [Sat, 13 Feb 2016 03:45:32 +0000 (03:45 +0000)]
Implement copy_file_range syscall decoding

* copy_file_range.c: New file.
* Makefile.am (strace_SOURCES): Add it.
* linux/32/syscallent.h (copy_file_range): New entry.
* linux/64/syscallent.h: Likewise.
* linux/arm/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/powerpc64/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/sparc64/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.
* pathtrace.c (pathtrace_match): Add SEN_copy_file_range.
* NEWS: Mention new syscall parser.
* tests/copy_file_range.c: New file.
* tests/copy_file_range.test: New test.
* tests/.gitignore: Add copy_file_range.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add copy_file_range.test.

8 years agoUpdate fs *_MAGIC constants
Dmitry V. Levin [Sat, 13 Feb 2016 03:20:13 +0000 (03:20 +0000)]
Update fs *_MAGIC constants

* xlat/fsmagic.in: Add CGROUP2_SUPER_MAGIC and OVERLAYFS_SUPER_MAGIC.

8 years agoUpdate IPV6_* constants
Dmitry V. Levin [Sat, 13 Feb 2016 03:17:13 +0000 (03:17 +0000)]
Update IPV6_* constants

* xlat/sockipv6options.in: Add IPV6_HDRINCL.

8 years agoUpdate SO_* constants
Dmitry V. Levin [Sat, 13 Feb 2016 03:10:08 +0000 (03:10 +0000)]
Update SO_* constants

* xlat/sockoptions.in: Add SO_ATTACH_REUSEPORT_CBPF
and SO_ATTACH_REUSEPORT_EBPF.

8 years agoUpdate MADV_* constants
Dmitry V. Levin [Sat, 13 Feb 2016 03:08:36 +0000 (03:08 +0000)]
Update MADV_* constants

* xlat/madvise_cmds.in: Add MAD_FREE.

8 years agotests: robustify execve and execveat tests
Dmitry V. Levin [Sat, 13 Feb 2016 01:23:26 +0000 (01:23 +0000)]
tests: robustify execve and execveat tests

* tests/execve.c (main): Use one page gap between two mapped regions
for an address that is more likely to be not yet mapped.
* tests/execveat.c (main): Likewise.

8 years agotests: simplify execve test
Dmitry V. Levin [Sat, 13 Feb 2016 01:20:39 +0000 (01:20 +0000)]
tests: simplify execve test

* tests/execve.c (main): Simplify the test assuming that execve syscall
never returns ENOSYS.

8 years agoFix numbers of syscall arguments in syscall tables
Dmitry V. Levin [Fri, 12 Feb 2016 19:50:38 +0000 (19:50 +0000)]
Fix numbers of syscall arguments in syscall tables

This semi-automatic change brings syscall tables in sync with kernel's
include/linux/syscalls.h file.

* linux/aarch64/syscallent.h (recv): Fix nargs.
* linux/alpha/syscallent.h (sigaltstack, init_module,
sched_getscheduler, settimeofday): Likewise.
* linux/arm/syscallent.h (signal, pciconfig_iobase, msgrcv, msgctl,
shmat, shmdt, shmctl, semtimedop, get_mempolicy, set_mempolicy,
timerfd_create): Likewise.
* linux/bfin/syscallent.h (signal, delete_module): Likewise.
* linux/hppa/syscallent.h (init_module, munlockall, sched_getscheduler,
io_cancel, set_tid_address, listxattr, llistxattr, flistxattr,
removexattr, lremovexattr, fremovexattr): Likewise.
* linux/i386/syscallent.h (signal, mmap): Likewise.
* linux/ia64/syscallent.h (init_module, readv, writev,
sched_getscheduler): Likewise.
* linux/m68k/syscallent.h (signal, request_key): Likewise.
* linux/microblaze/syscallent.h (signal, clone, fstatfs64, vmsplice):
Likewise.
* linux/mips/syscallent-n32.h (getpgid, statfs, fstatfs, init_module,
delete_module): Likewise.
* linux/mips/syscallent-n64.h (getpgid, statfs, fstatfs, init_module,
delete_module): Likewise.
* linux/mips/syscallent-o32.h (signal, statfs, fstatfs, ioperm,
fstatfs64): Likewise.
* linux/powerpc/syscallent.h (signal, spu_run, spu_create): Likewise.
* linux/powerpc64/syscallent.h (signal, pread64, pwrite64, readahead,
fadvise64, lookup_dcookie, spu_run, spu_create, sync_file_range2,
fallocate, preadv, pwritev, fanotify_mark): Likewise.
* linux/s390/syscallent.h (signal, mmap, lookup_dcookie, ipc): Likewise.
* linux/s390x/syscallent.h (signal, ipc): Likewise.
* linux/sh/syscallent.h (signal, ipc, munlockall, fstatfs64, vmsplice):
Likewise.
* linux/sh64/syscallent.h (signal, ipc, msgrcv, msgctl, shmat, shmdt,
shmctl, fstatfs64, vmsplice): Likewise.
* linux/sparc/syscallent.h (ptrace, dup, signal, ipc): Likewise.
* linux/sparc64/syscallent.h (ptrace, dup, signal, pread64, pwrite64,
readahead, lookup_dcookie, fadvise64, fadvise64_64, ipc,
sync_file_range, fallocate, preadv, pwritev, fanotify_mark): Likewise.
* linux/x32/syscallent.h (64:recvmsg): Likewise.
* linux/xtensa/syscallent.h (mremap, futex, reboot, init_module,
delete_module, request_key, getcpu, ioprio_set, ioprio_get, utimensat,
futimesat, fchmodat, faccessat): Likewise.
* NEWS: Mention this fix.

8 years agos390: decode fadvise64 and fadvise64_64
Dmitry V. Levin [Fri, 12 Feb 2016 19:28:34 +0000 (19:28 +0000)]
s390: decode fadvise64 and fadvise64_64

* linux/s390/syscallent.h (fadvise64): Set sys_func.
(fadvise64_64): Set nargs and sys_func.

8 years agomips n64: use the most optimal parser for fadvise64 syscall
Dmitry V. Levin [Fri, 12 Feb 2016 19:24:50 +0000 (19:24 +0000)]
mips n64: use the most optimal parser for fadvise64 syscall

* linux/mips/syscallent-n64.h (fadvise64): Replace SEN(fadvise64_64)
with SEN(fadvise64).

8 years agoia64: decode fstatfs64 and statfs64
Dmitry V. Levin [Fri, 12 Feb 2016 19:21:42 +0000 (19:21 +0000)]
ia64: decode fstatfs64 and statfs64

* linux/ia64/syscallent.h (fstatfs64, statfs64): Set nargs and sys_func.

8 years agoalpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments
Dmitry V. Levin [Fri, 12 Feb 2016 19:44:29 +0000 (19:44 +0000)]
alpha, ia64, mips, sh, sh64: fix the number of pipe syscall arguments

On alpha, ia64, mips, sh, sh64, sparc, and sparc64 architectures
pipe syscall does not take arguments.

* linux/alpha/syscallent.h (pipe): Change nargs to 0.
* linux/ia64/syscallent.h (pipe): Likewise.
* linux/mips/syscallent-n32.h (pipe): Likewise.
* linux/mips/syscallent-n64.h (pipe): Likewise.
* linux/mips/syscallent-o32.h (pipe): Likewise.
* linux/sh/syscallent.h (pipe): Likewise.
* linux/sh64/syscallent.h (pipe): Likewise.

8 years agoalpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall
Dmitry V. Levin [Fri, 12 Feb 2016 16:37:31 +0000 (16:37 +0000)]
alpha, ia64, mips, sh*, sparc*: fix error path decoding of pipe syscall

* net.c (do_pipe) [HAVE_GETRVAL2]: Remove.
Always call decode_pair_fd on exiting.
(SYS_FUNC(pipe)) [HAVE_GETRVAL2]: Call printpair_fd instead of do_pipe.

8 years agoFix pathtrace match for pipe2 syscall
Dmitry V. Levin [Fri, 12 Feb 2016 16:15:23 +0000 (16:15 +0000)]
Fix pathtrace match for pipe2 syscall

* pathtrace.c (pathtrace_match): As pipe2 syscall has no descriptors
or paths to test, move SEN_pipe2 to the appropriate category.

8 years agoavr32: wire up missing syscalls
Dmitry V. Levin [Fri, 12 Feb 2016 15:00:29 +0000 (15:00 +0000)]
avr32: wire up missing syscalls

* linux/avr32/syscallent.h [322..324]: Add userfaultfd, membarrier,
and mlock2 entries.

8 years agotests: check decoding of madvise, mlockall, mremap, and msync syscalls
Dmitry V. Levin [Fri, 12 Feb 2016 01:56:10 +0000 (01:56 +0000)]
tests: check decoding of madvise, mlockall, mremap, and msync syscalls

* tests/mmap.c (main): Change output format from regexp to verbatim.
Add tests for madvise, mlockall, mremap, and msync syscalls.
* tests/mmap.test: Convert from match_grep to match_diff.
Add madvise, mlockall, mremap, and msync syscalls to syscall filter.

8 years agoSimplify decoding of waitpid and wait4 syscalls
Dmitry V. Levin [Thu, 11 Feb 2016 02:39:04 +0000 (02:39 +0000)]
Simplify decoding of waitpid and wait4 syscalls

* wait.c (printwaitn): Replace "n" and "bitness" integer arguments
with a single print_rusage function pointer.  All callers updated.

8 years agowaitid: print pid argument as int
Dmitry V. Levin [Thu, 11 Feb 2016 02:42:36 +0000 (02:42 +0000)]
waitid: print pid argument as int

* wait.c (SYS_FUNC(waitid)): As the type of second syscall argument
in the kernel is pid_t, print it as int.

8 years agowaitid: always print 5th argument
Dmitry V. Levin [Thu, 11 Feb 2016 02:20:18 +0000 (02:20 +0000)]
waitid: always print 5th argument

* wait.c (SYS_FUNC(waitid)): Do not check for tcp->s_ent->nargs
as waitid syscall has 5 arguments.

8 years agosocketutils: add const qualifier to variables
Dmitry V. Levin [Wed, 10 Feb 2016 17:43:09 +0000 (17:43 +0000)]
socketutils: add const qualifier to variables

* socketutils.c (cache_and_print_inode_details): Make "details"
parameter const.
(print_sockaddr_by_inode_cached): Make "e" variable const.
(inet_send_query): Make struct nlmsghdr and struct inet_diag_req_v2
members const.  Make "msg" variable const.
(inet_parse_response): Make "data" parameter and diag_msg variable const.
(receive_responses): Make "h" and "rc" variables const.
(unix_send_query): Make struct nlmsghdr and struct unix_diag_req
members const.  Make "msg" variable const.
(unix_print): Make all parameters const.
(print_sockaddr_by_inode): Make proto_name parameter const.

8 years agoprint_sockaddr_by_inode: cleanup protocol lookup
Dmitry V. Levin [Wed, 10 Feb 2016 17:39:57 +0000 (17:39 +0000)]
print_sockaddr_by_inode: cleanup protocol lookup

* socketutils.c (tcp_v4_print, udp_v4_print, tcp_v6_print,
udp_v6_print): New functions.
(print_sockaddr_by_inode): Make "protocols" array static, replace
"family" and "protocol" members with "print" in its underlying
structure.  Iterate through protocols array when the protocol name
is specified.

8 years agotests: check that -f -p attaches to threads properly
Dmitry V. Levin [Tue, 9 Feb 2016 04:16:41 +0000 (04:16 +0000)]
tests: check that -f -p attaches to threads properly

Check that -f -p attaches and follows all threads of the given pid.

* tests/attach-f-p.c: New file.
* tests/attach-f-p.test: New test.
* tests/.gitignore: Add attach-f-p.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(attach_f_p_LDADD): New variable.
(TESTS): Add attach-f-p.test.

8 years agoIntroduce libstrace.a for potentially conditional compilation units
Dmitry V. Levin [Thu, 4 Feb 2016 02:49:01 +0000 (02:49 +0000)]
Introduce libstrace.a for potentially conditional compilation units

Some files are used conditionally depending on architecture and
configuration.  Create a library for the purpose of keeping such
compilation units.

* Makefile.am (strace_LDADD, noinst_LIBRARIES): Add libstrace.a.
(libstrace_a_CPPFLAGS): New variable, set to $(strace_CPPFLAGS).
(libstrace_a_CFLAGS): New variable, set to $(strace_CFLAGS).
(libstrace_a_SOURCES): New variable, set to upeek.c.
* util.c (upeek): Move ...
* upeek.c: ... here.

8 years agotravis-ci: pass more gcov arguments to codecov
Dmitry V. Levin [Sun, 7 Feb 2016 22:47:40 +0000 (22:47 +0000)]
travis-ci: pass more gcov arguments to codecov

8 years agotests: extend coverage of struct itimerspec
Dmitry V. Levin [Mon, 8 Feb 2016 00:13:00 +0000 (00:13 +0000)]
tests: extend coverage of struct itimerspec

* tests/timer_xettime.c (main): Check decoding of NULL struct itimerspec
pointer.

8 years agotests: extend coverage of utimensat syscall
Dmitry V. Levin [Mon, 8 Feb 2016 00:01:57 +0000 (00:01 +0000)]
tests: extend coverage of utimensat syscall

* tests/utimensat.c (main): Check decoding of NULL struct timespec
pointer.

8 years agotests: extend coverage of time syscall
Dmitry V. Levin [Sun, 7 Feb 2016 23:46:33 +0000 (23:46 +0000)]
tests: extend coverage of time syscall

* tests/time.c (main): Check decoding of NULL time_t pointer.

8 years agotests: extend coverage of struct sigevent
Dmitry V. Levin [Sun, 7 Feb 2016 23:28:18 +0000 (23:28 +0000)]
tests: extend coverage of struct sigevent

* tests/timer_create.c (main): Check decoding of NULL struct sigevent
pointer.  Check decoding of invalid sigev_notify value.

8 years agotests: extend coverage of execve and execveat syscalls
Dmitry V. Levin [Sun, 7 Feb 2016 14:37:53 +0000 (14:37 +0000)]
tests: extend coverage of execve and execveat syscalls

Check decoding of inaccessible or partially inaccessible arrays.

* tests/execve-v.c: New file.
* tests/execveat-v.c: Likewise.
* tests/execve-v.test: New test.
* tests/execveat-v.test: Likewise.
* tests/execve.c: Rewrite.
* tests/execveat.c: Likewise.
* tests/execve.test: Likewise.
* tests/execveat.test: Likewise.
* tests/execve.expected: Remove.
* tests/execve-v.expected: Likewise.
* tests/execveat.expected: Likewise.
* tests/execveat-v.expected: Likewise.
* tests/.gitignore: Add execve-v and execveat-v.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add execve-v.test and execveat-v.test.
(EXTRA_DIST): Remove execve.expected, execve-v.expected,
execveat.expected, and execveat-v.expected.

8 years agoFix decoding of execve and execveat syscalls with invalid input
Dmitry V. Levin [Sun, 7 Feb 2016 14:38:45 +0000 (14:38 +0000)]
Fix decoding of execve and execveat syscalls with invalid input

* execve.c (printargv): Fix decoding of inaccessible or partially
inaccessible array.
(printargc): Diagnose inaccessible or partially inaccessible array.
(decode_execve, SYS_FUNC(execv)): Update printargv and printargc callers.

8 years agotests: extend coverage of capget syscall
Dmitry V. Levin [Sat, 6 Feb 2016 01:40:09 +0000 (01:40 +0000)]
tests: extend coverage of capget syscall

* tests/caps.c (main): Check decoding of inaccessible cap_user_header_t
and/or cap_user_data_t.
* tests/caps.awk: Update match patterns.
* tests/caps.test: Update.

8 years agotests: extend coverage of sched_getaffinity syscall
Dmitry V. Levin [Sat, 6 Feb 2016 01:12:22 +0000 (01:12 +0000)]
tests: extend coverage of sched_getaffinity syscall

* tests/sched_xetaffinity.c (main): Check decoding of pointer
to inaccessible cpu_set_t.

8 years agotests: extend coverage of utime syscall
Dmitry V. Levin [Sat, 6 Feb 2016 00:56:55 +0000 (00:56 +0000)]
tests: extend coverage of utime syscall

* tests/utime.c (main): Check decoding of NULL struct utimbuf pointer.
Check decoding of struct utimbuf located at the end of page boundary.
* tests/utime.test: Update.

8 years agotests: extend coverage of sysinfo syscall
Dmitry V. Levin [Sat, 6 Feb 2016 00:56:34 +0000 (00:56 +0000)]
tests: extend coverage of sysinfo syscall

* tests/sysinfo.c (main): Check decoding of NULL struct sysinfo pointer.
Check decoding of struct sysinfo located at the end of page boundary.
* tests/sysinfo.test: Update.

8 years agotests: extend coverage of adjtimex syscall
Dmitry V. Levin [Sat, 6 Feb 2016 00:56:15 +0000 (00:56 +0000)]
tests: extend coverage of adjtimex syscall

* tests/adjtimex.c (main): Check decoding of NULL struct timex pointer.
Check decoding of struct timex located at the end of page boundary.
* tests/adjtimex.test: Update.

8 years agotests: check that strace does not retain stdin and stdout descriptors
Dmitry V. Levin [Mon, 8 Feb 2016 16:47:40 +0000 (16:47 +0000)]
tests: check that strace does not retain stdin and stdout descriptors

* tests/redirect.test: New test.
* tests/Makefile.am (TESTS): Add it.

8 years agoCreate a dummy pipe descriptor instead of opening /dev/null
Dmitry V. Levin [Mon, 8 Feb 2016 17:46:58 +0000 (17:46 +0000)]
Create a dummy pipe descriptor instead of opening /dev/null

* strace.c (open_dev_null): Rename to open_dummy_desc.  All callers
changed.  Create a pipe and return its first descriptor instead of
opening /dev/null.

8 years agoIf stdin/stdout aren't open on startup, open them to /dev/null
Denys Vlasenko [Mon, 8 Feb 2016 17:08:46 +0000 (18:08 +0100)]
If stdin/stdout aren't open on startup, open them to /dev/null

Otherwise, -oLOGFILE may end up using one of them. This conflicts
with the previous change, which closes stdin/out in strace.

* strace.c (init): If fcntl(F_GETFD) fails on stdin or stdout,
sanitize them: open /dev/null and dup it until fds 0,1,2
are all used up.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
8 years agoClose stdin/out after child is forked
Denys Vlasenko [Mon, 8 Feb 2016 13:52:32 +0000 (14:52 +0100)]
Close stdin/out after child is forked

Testcase:

{ sleep 1; yes | head -n99999; } | strace -o/dev/null sh -c 'exec <&-; sleep 9'

The writer (head) will be able to perform writes to write end of the pipe.
With strace call removed, head will immediately get SIGPIPE.

This change fixes this: now writer immediately gets SIGPIPE with strace too.

* strace.c (startup_child): Close stdin/out and reopen them to /dev/null.

Signed-off-by: Denys Vlasenko <dvlasenk@redhat.com>
8 years agotests: add opipe.test
Dmitry V. Levin [Fri, 5 Feb 2016 01:19:37 +0000 (01:19 +0000)]
tests: add opipe.test

Check that -o |pipe_command works.  In particular, check that
strace waits for completion of piped command.

* tests/opipe.test: New test.
* tests/Makefile.am (TESTS): Add it.

8 years agostrace-graph: print the pid in the graph
Keith Owens [Mon, 18 Jan 2016 02:15:36 +0000 (13:15 +1100)]
strace-graph: print the pid in the graph

* strace-graph: Prefix each command with its pid.

8 years agostrace-graph: cope with clone immediately followed by exit
Keith Owens [Mon, 18 Jan 2016 02:12:26 +0000 (13:12 +1100)]
strace-graph: cope with clone immediately followed by exit

* strace-graph: A clone() followed by exit() with no intervening fork
or execve resulted in the new pid having no seq key.  That breaks when
trying to use seq as an array reference.  Ensure that clone populates
the new pid with an empty seq entry.

8 years agostrace-graph: handle recent strace output
Keith Owens [Mon, 18 Jan 2016 02:09:59 +0000 (13:09 +1100)]
strace-graph: handle recent strace output

* strace-graph: Fix regex for --SIG.  Ignore '+++ exited with <n> +++'
lines.  Handle exit_group syscall as well as _exit.

8 years agostrace-graph: handle strace -T
Keith Owens [Mon, 18 Jan 2016 02:03:41 +0000 (13:03 +1100)]
strace-graph: handle strace -T

* strace-graph: Ignore extra ' <time.spent>' field added by strace -T.

8 years agostrace-graph: use "strict" and "warnings" pragmas
Keith Owens [Mon, 18 Jan 2016 01:57:41 +0000 (12:57 +1100)]
strace-graph: use "strict" and "warnings" pragmas

* strace-graph: Set "use strict" and "use warnings" options.  Fix errors
detected by strict/warnings.  $result is really a string, it can be "-1"
followed by an error text.

8 years agoAdd README.md file with links to build status and test coverage
Dmitry V. Levin [Thu, 4 Feb 2016 18:20:14 +0000 (18:20 +0000)]
Add README.md file with links to build status and test coverage

8 years agotravis-ci: prepare and submit test coverage report
Dmitry V. Levin [Thu, 4 Feb 2016 00:16:11 +0000 (00:16 +0000)]
travis-ci: prepare and submit test coverage report

8 years agotests: extend readlink and readlinkat coverage
Dmitry V. Levin [Thu, 4 Feb 2016 01:32:45 +0000 (01:32 +0000)]
tests: extend readlink and readlinkat coverage

* tests/readlink.c (PREFIX, TARGET, LINKPATH): New macros.
(main): Allocate memory for string and buffer passed to the syscall
being tested using tail_alloc mechanism.  Create and cleanup test
symlink.  Test syscall error path output.  Print hexquoted strings
using hexquote_strndup.
* tests/readlinkat.c: Likewise.
* tests/readlink.test: Remove creation and cleanup of test symlinks.

8 years agotests: add hexquote_strndup function to libtests
Dmitry V. Levin [Thu, 4 Feb 2016 01:59:35 +0000 (01:59 +0000)]
tests: add hexquote_strndup function to libtests

* tests/tests.h (hexquote_strndup): New prototype.
* tests/hexquote_strndup.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.

8 years agoreadlinkat.test: use readlink.test
Dmitry V. Levin [Thu, 4 Feb 2016 01:29:35 +0000 (01:29 +0000)]
readlinkat.test: use readlink.test

* tests/readlink.test (syscall): Initialize from $0.
* tests/readlinkat.test: Source readlink.test.

8 years agoAdd configure --enable-code-coverage option
Gabriel Laskar [Mon, 1 Feb 2016 17:15:39 +0000 (18:15 +0100)]
Add configure --enable-code-coverage option

* m4/ax_code_coverage.m4: New file.
* configure.ac: Use AX_CODE_COVERAGE.
* Makefile.am: Add @CODE_COVERAGE_RULES@.
(CODE_COVERAGE_LCOV_OPTIONS, CODE_COVERAGE_GENHTML_OPTIONS,
CODE_COVERAGE_IGNORE_PATTERN): New variables.
(strace_CPPFLAGS): Add $(CODE_COVERAGE_CPPFLAGS).
(strace_CFLAGS): Add $(CODE_COVERAGE_CFLAGS).
(strace_LDADD): Add $(CODE_COVERAGE_LDFLAGS).
* .gitignore: Add *.gcda and *.gcno.

Signed-off-by: Gabriel Laskar <gabriel@lse.epita.fr>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
8 years agoMakefile.am: introduce strace_CFLAGS and derivatives
Dmitry V. Levin [Wed, 3 Feb 2016 19:19:48 +0000 (19:19 +0000)]
Makefile.am: introduce strace_CFLAGS and derivatives

* Makefile.am (strace_CFLAGS): New variable, set to $(AM_CFLAGS).
(libmpers_CFLAGS): New variable, set to $(strace_CFLAGS).
(libmpers_m32_a_CFLAGS, libmpers_mx32_a_CFLAGS): New variables,
set to $(libmpers_CFLAGS).

8 years agoMakefile.am: use strace_CPPFLAGS consistently
Dmitry V. Levin [Wed, 3 Feb 2016 19:18:28 +0000 (19:18 +0000)]
Makefile.am: use strace_CPPFLAGS consistently

* Makefile.am (libmpers_CPPFLAGS): Replace $(AM_CPPFLAGS)
with $(strace_CPPFLAGS).

8 years agotests: replace net-fd.test with net-y-unix.test
Dmitry V. Levin [Tue, 2 Feb 2016 19:48:46 +0000 (19:48 +0000)]
tests: replace net-fd.test with net-y-unix.test

Unlike the former test that was based on match_grep,
the new one uses match_diff and does more rigorous testing.

* tests/net-y-unix.c: New file.
* tests/net-y-unix.test: New test.
* tests/net-fd.test: Remove.
* tests/net-fd.expected: Remove.
* tests/.gitignore: Add net-y-unix.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Replace net-fd.test with net-y-unix.test.
(net-fd.log): Remove.
(EXTRA_DIST): Remove net-fd.expected.

8 years agoImplement caching of print_sockaddr_by_inode
Dmitry V. Levin [Mon, 1 Feb 2016 23:14:59 +0000 (23:14 +0000)]
Implement caching of print_sockaddr_by_inode

As -yy parser, compared to -y, needs to do at least 5 extra syscalls
(getxattr, socket, sendmsg, recvmsg, close) to print socket details,
caching results of netlink conversations between strace and kernel
noticeably reduces amount of system time spent by strace.

The caching is safe since sockets do not change their addresses after
successful bind or connect syscall.

* defs.h (string_quote, print_sockaddr_by_inode_cached): New prototypes.
* socketutils.c (cache_entry): New type.
(CACHE_SIZE, CACHE_MASK): New macros.
(cache): New static array.
(cache_and_print_inode_details): New static function.
(print_sockaddr_by_inode_cached): New function.
(inet_parse_response, unix_parse_response): Use
cache_and_print_inode_details.
* util.c (printfd): Use string_quote and print_sockaddr_by_inode_cached.
(string_quote): Remove static qualifier.
* NEWS: Mention this improvement.
* tests/unix-yy.c (main): Update.

8 years agoChange unix_diag requests to use exact match instead of full dump
Dmitry V. Levin [Sun, 31 Jan 2016 00:35:29 +0000 (00:35 +0000)]
Change unix_diag requests to use exact match instead of full dump

* socketutils.c (unix_send_query): Remove NLM_F_DUMP from nlmsg_flags,
initialize udiag_cookie.
* tests/netlink_unix_diag.c (send_query): Remove "family" and "proto"
arguments, add "inode" argument, remove NLM_F_DUMP from nlmsg_flags,
initialize udiag_ino and udiag_cookie.
(check_responses): Add "inode" argument, check inode match.
(main): Pass listening socket inode to send_query and check_responses.

8 years agoRobustify netlink response parsers
Dmitry V. Levin [Sat, 30 Jan 2016 23:50:54 +0000 (23:50 +0000)]
Robustify netlink response parsers

* socketutils.c (inet_parse_response, unix_parse_response): Change
return type from bool to int, return -1 on all parse errors except
inode mismatch.
(receive_responses): Stop on the first nlmsg_type that is not
SOCK_DIAG_BY_FAMILY, also stop when the parser returns -1.
* tests/netlink_inet_diag.c (check_responses): Stop on short messages,
on first nlmsg_type that is not SOCK_DIAG_BY_FAMILY, print more verbose
diagnostics for NLMSG_ERROR.
* tests/netlink_unix_diag.c (check_responses): Likewise.

8 years agoinet_parse_response: add a safety check
Dmitry V. Levin [Thu, 28 Jan 2016 23:46:56 +0000 (23:46 +0000)]
inet_parse_response: add a safety check

* socketutils.c (inet_parse_response): Check that netlink message
is large enough to contain a inet_diag_msg structure.

8 years agoreceive_responses: avoid potential hangup
Dmitry V. Levin [Wed, 27 Jan 2016 21:35:50 +0000 (21:35 +0000)]
receive_responses: avoid potential hangup

* socketutils.c (receive_responses): Pass MSG_DONTWAIT to recvmsg after
the first recvmsg call to avoid potential hangup.

8 years agotests: replace net-yy.test with net-yy-inet.test
Dmitry V. Levin [Tue, 26 Jan 2016 22:03:22 +0000 (22:03 +0000)]
tests: replace net-yy.test with net-yy-inet.test

Unlike the former test that was based on match_awk,
the new one uses match_diff and does more rigorous testing.

* tests/net-yy-inet.c: New file.
* tests/net-yy-inet.test: New test.
* tests/net-yy.test: Remove.
* tests/net-yy-accept.awk: Remove.
* tests/net-yy-connect.awk: Remove.
* tests/inet-accept-connect-send-recv.c: Remove.
* tests/.gitignore: Replace inet-accept-connect-send-recv
with net-yy-inet.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Replace net-yy.test with net-yy-inet.test.
(EXTRA_DIST): Remove net-yy-accept.awk and net-yy-connect.awk.

8 years agotests: replace unix-yy.test with net-yy-unix.test
Dmitry V. Levin [Mon, 25 Jan 2016 22:20:54 +0000 (22:20 +0000)]
tests: replace unix-yy.test with net-yy-unix.test

Unlike the former test that was based on match_awk,
the new one uses match_diff and does more rigorous testing.

* tests/net-yy-unix.c: New file.
* tests/net-yy-unix.test: New test.
* tests/unix-yy.test: Remove.
* tests/unix-yy-accept.awk: Remove.
* tests/unix-yy-connect.awk: Remove.
* tests/.gitignore: Add net-yy-unix.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Replace unix-yy.test with net-yy-unix.test.
(EXTRA_DIST): Remove unix-yy-accept.awk and unix-yy-connect.awk.

8 years agotests: add inode_of_sockfd function to libtests
Dmitry V. Levin [Mon, 25 Jan 2016 22:20:40 +0000 (22:20 +0000)]
tests: add inode_of_sockfd function to libtests

* tests/tests.h (inode_of_sockfd): New prototype.
* tests/inode_of_sockfd.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.

8 years agounix_parse_response: add a safety check
Dmitry V. Levin [Sat, 23 Jan 2016 22:46:40 +0000 (01:46 +0300)]
unix_parse_response: add a safety check

* socketutils.c (unix_parse_response): Check that netlink message
is large enough to contain a unix_diag_msg structure.

8 years agoFixed decoding of mincore syscall's last argument
Dmitry V. Levin [Fri, 29 Jan 2016 01:51:54 +0000 (01:51 +0000)]
Fixed decoding of mincore syscall's last argument

* mem.c (SYS_FUNC(mincore)): Print only those bytes of the vector
that were written by the kernel.
* NEWS: Mention this fix.
* tests/mincore.c: New file.
* tests/mincore.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add mincore.
(TESTS): Add mincore.test.
* tests/.gitignore: Add mincore.

8 years agoMove fallback -yy socket print from printfd to print_sockaddr_by_inode
Dmitry V. Levin [Sat, 23 Jan 2016 16:35:02 +0000 (16:35 +0000)]
Move fallback -yy socket print from printfd to print_sockaddr_by_inode

* util.c (printfd): In -yy mode, move fallback print of proto:[inode] ...
* socketutils.c (to print_sockaddr_by_inode): ... here.

8 years agoImplement simultaneous use of -p option and tracing of a command
Dmitry V. Levin [Fri, 22 Jan 2016 14:37:14 +0000 (14:37 +0000)]
Implement simultaneous use of -p option and tracing of a command

* strace.c (init): Allow -p option along with a command.
(startup_child): In -D mode, record the parent of the tracer process
as strace_child.
(startup_attach): Save trace_tracer_pid before -D mode fork.
When tracing a command in -f mode, do not check for the command's
threads as it has no threads at this moment.
Never attach to the tracer process.
In -D mode, never attach to the parent of the tracer process,
terminate that process only once at the end of startup_attach,
and reset strace_child.
* strace.1: Document that -p option can be used along with tracing
of a command.
* NEWS: Mention it.
* tests/attach-p-cmd-cmd.c: New file.
* tests/attach-p-cmd-p.c: Likewise.
* tests/attach-p-cmd.test: New test.
* tests/.gitignore: Add attach-p-cmd-cmd and attach-p-cmd-p.
* tests/Makefile.am (check_PROGRAMS): Likewise.
(TESTS): Add attach-p-cmd.test.

This fixes Debian bug #549942.

8 years agostrace.1: fix format of -P description
Dmitry V. Levin [Fri, 22 Jan 2016 14:53:40 +0000 (14:53 +0000)]
strace.1: fix format of -P description

* strace.1 (-P): Write trailing using regular font.

8 years agotests: use local nanosleep based sleep utility replacement
Dmitry V. Levin [Thu, 21 Jan 2016 23:52:39 +0000 (23:52 +0000)]
tests: use local nanosleep based sleep utility replacement

* tests/sleep.c: New file.
* tests/.gitignore: Add sleep.
* tests/Makefile.am (check_PROGRAMS): Likewise.
* tests/count.test: Use it instead of system sleep utility.

8 years agotests: add error_msg_and_fail function to libtests
Dmitry V. Levin [Thu, 21 Jan 2016 23:46:43 +0000 (23:46 +0000)]
tests: add error_msg_and_fail function to libtests

* tests/tests.h (error_msg_and_fail): New prototype.
* tests/error_msg.c (error_msg_and_fail): New function.

8 years agoFix dumping of recvmmsg syscall in case of short read
Dmitry V. Levin [Wed, 20 Jan 2016 04:56:25 +0000 (04:56 +0000)]
Fix dumping of recvmmsg syscall in case of short read

* net.c (dumpiov_in_mmsghdr): Call dumpiov_upto instead of dumpiov,
pass data size limit to dumpiov_upto.
* NEWS: Mention this fix.
* tests/mmsg.c (main): Update.

8 years agoFix dumping of recvmsg syscall in case of short read
Dmitry V. Levin [Wed, 20 Jan 2016 03:26:37 +0000 (03:26 +0000)]
Fix dumping of recvmsg syscall in case of short read

* defs.h (dumpiov_in_msghdr): Add unsigned long argument.
* net.c (dumpiov_in_msghdr): Add data_size argument.  Call dumpiov_upto
instead of dumpiov, pass data_size to dumpiov_upto.
* syscall.c (dumpio): Pass data size limit to dumpiov_in_msghdr.
* NEWS: Mention this fix.
* tests/recvmsg.c: New file.
* tests/recvmsg.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add recvmsg.
(TESTS): Add recvmsg.test.
* tests/.gitignore: Add recvmsg.

8 years agoFix decoding and dumping of readv syscall in case of short read
Dmitry V. Levin [Wed, 20 Jan 2016 00:17:02 +0000 (00:17 +0000)]
Fix decoding and dumping of readv syscall in case of short read

* defs.h (dumpiov_upto): New prototype.
(dumpiov): Change to a wrapper around dumpiov_upto.
* util.c (dumpiov): Rename to dumpiov_upto, add and check data_size
argument.
* io.c (SYS_FUNC(readv)): Call tprint_iov_upto instead
of tprint_iov and specify syscall return value as a data size limit.
* syscall.c (dumpio): In case of SEN_readv, call dumpiov_upto instead
of dumpiov and specify syscall return value as a data size limit.
* NEWS: Mention this fix.
* tests/readv.c: New file.
* tests/readv.test: New test.
* tests/Makefile.am (check_PROGRAMS): Add readv.
(TESTS): Add readv.test.
* tests/.gitignore: Add readv.

8 years agotests/tests.h: add ARRAY_SIZE and LENGTH_OF macros
Dmitry V. Levin [Wed, 20 Jan 2016 05:08:04 +0000 (05:08 +0000)]
tests/tests.h: add ARRAY_SIZE and LENGTH_OF macros

* tests/tests.h (ARRAY_SIZE, LENGTH_OF): New macros.
* tests/aio.c (ARRAY_SIZE): Remove.
* tests/mmsg.c (LENGTH_OF): Remove.

8 years agotests: add hexdump_strdup function to libtests
Dmitry V. Levin [Wed, 20 Jan 2016 05:26:43 +0000 (05:26 +0000)]
tests: add hexdump_strdup function to libtests

* tests/tests.h (hexdump_strdup): New prototype.
* tests/hexdump_strdup.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.

8 years agotests: add tprintf function to libtests
Dmitry V. Levin [Wed, 20 Jan 2016 02:06:59 +0000 (02:06 +0000)]
tests: add tprintf function to libtests

* tests/tests.h (tprintf): New prototype.
* tests/tprintf.c: New file.
* tests/Makefile.am (libtests_a_SOURCES): Add it.
* tests/mmsg.c: Use tprintf.

8 years agoquotactl: add Q_XGETQSTATV command decoding
Dmitry V. Levin [Tue, 19 Jan 2016 21:48:59 +0000 (21:48 +0000)]
quotactl: add Q_XGETQSTATV command decoding

* quota.c (fs_qfilestatv, fs_quota_statv): New structures.
(decode_cmd_data): Handle Q_XGETQSTATV case.

8 years agoquotactl: add decoding of if_dqinfo.dqi_flags constants
Dmitry V. Levin [Tue, 19 Jan 2016 02:10:23 +0000 (02:10 +0000)]
quotactl: add decoding of if_dqinfo.dqi_flags constants

* xlat/if_dqinfo_flags.in: New file.
* quota.c: Include "xlat/if_dqinfo_flags.h".
(decode_cmd_data): Print struct if_dqinfo.dqi_flags using printflags.

8 years agoquotactl: consistenly decode all write and unknown commands on entering
Dmitry V. Levin [Tue, 19 Jan 2016 01:15:49 +0000 (01:15 +0000)]
quotactl: consistenly decode all write and unknown commands on entering

* quota.c (decode_cmd_data): Change return type to int.
Return 0 on entering Q_GETQUOTA, Q_V1_GETQUOTA, Q_V2_GETQUOTA,
Q_XGETQUOTA, Q_GETFMT, Q_GETINFO, Q_V2_GETINFO, Q_V1_GETSTATS,
Q_V2_GETSTATS, and Q_XGETQSTAT commands, return RVAL_DECODED
for any other command.
(SYS_FUNC(quotactl)): On entering, print third argument of any command.
For any command except Q_QUOTAON and Q_V1_QUOTAON, call decode_cmd_data
and forward its return value.

8 years agoquotactl: fix Q_QUOTAON command decoding
Dmitry V. Levin [Mon, 18 Jan 2016 21:53:54 +0000 (21:53 +0000)]
quotactl: fix Q_QUOTAON command decoding

* quota.c (SYS_FUNC(quotactl)): Print Q_QUOTAON 4th argument as a path.

8 years agoquotactl: print third argument as unsigned int
Dmitry V. Levin [Mon, 18 Jan 2016 21:47:04 +0000 (21:47 +0000)]
quotactl: print third argument as unsigned int

* quota.c (SYS_FUNC(quotactl)): Consistently print the third
argument using "%u" format.

8 years agoquotactl: fix Q_XQUOTAOFF command decoding
Dmitry V. Levin [Mon, 18 Jan 2016 21:41:22 +0000 (21:41 +0000)]
quotactl: fix Q_XQUOTAOFF command decoding

* quota.c (decode_cmd_data): Print xfs quota flags argument.

8 years agoquotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding
Dmitry V. Levin [Mon, 18 Jan 2016 21:34:42 +0000 (21:34 +0000)]
quotactl: fix Q_GETFMT and Q_XQUOTAON commands decoding

* quota.c (decode_cmd_data): As quota format value and xfs quota flags
are in-memory constants, print it like an array of one element instead
of a structure.

8 years agoUpdate quotactl constants
Dmitry V. Levin [Sun, 17 Jan 2016 22:30:54 +0000 (22:30 +0000)]
Update quotactl constants

* xlat/quota_formats.in: Add QFMT_OCFS2 and QFMT_VFS_V1.
* xlat/quotacmds.in: Add Q_XGETQSTATV.
* xlat/quotatypes.in: Add PRJQUOTA.
* xlat/xfs_quota_flags.in: Add FS_QUOTA_PDQ_ACCT and FS_QUOTA_PDQ_ENFD.

8 years agoReplace u_int{8,16,32,64} with uint{8,16,32,64}
Dmitry V. Levin [Sat, 16 Jan 2016 22:50:09 +0000 (22:50 +0000)]
Replace u_int{8,16,32,64} with uint{8,16,32,64}

* util.c: Replace u_int{32,64} with uint{32,64}.
* quota.c: Replace u_int{8,16,32,64} with uint{8,16,32,64}.

8 years agoMove definitions of quotactl constants to xlat files
Dmitry V. Levin [Sat, 16 Jan 2016 22:50:09 +0000 (22:50 +0000)]
Move definitions of quotactl constants to xlat files

* quota.c (Q_*): Move to xlat/quotacmds.in.
(USRQUOTA, GRPQUOTA): Move to xlat/quotatypes.in.
(QFMT_VFS_OLD, QFMT_VFS_V0): Move to xlat/quota_formats.in.
(XFS_QUOTA_*): Move to xlat/xfs_quota_flags.in.
(XFS_*_QUOTA): Move to xlat/xfs_dqblk_flags.in.
(QIF_*): Move to xlat/if_dqblk_valid.in.
(IIF_*): Move to xlat/if_dqinfo_valid.in.

8 years agollseek.test: robustify against libcs invoking _llseek syscall on their own
Dmitry V. Levin [Fri, 15 Jan 2016 00:10:00 +0000 (00:10 +0000)]
llseek.test: robustify against libcs invoking _llseek syscall on their own

* tests/llseek.test: Filter out _llseek calls made with non-negative
descriptor arguments.

8 years agolseek.test: robustify against libcs invoking lseek syscall on their own
Dmitry V. Levin [Fri, 15 Jan 2016 00:09:48 +0000 (00:09 +0000)]
lseek.test: robustify against libcs invoking lseek syscall on their own

* tests/lseek.test: Filter out lseek calls made with non-negative
descriptor arguments.

8 years agommsg.test: fix regression introduced by commit v4.11-138-g6e815ce
Dmitry V. Levin [Thu, 14 Jan 2016 00:06:20 +0000 (00:06 +0000)]
mmsg.test: fix regression introduced by commit v4.11-138-g6e815ce

This fixes the test on platforms where both __NR_sendmmsg and
HAVE_SENDMMSG are defined but the former is not implemented by the
kernel and the second is implemented as an indirect syscall.

* tests/mmsg.c (LENGTH_OF): New macro.
(send_mmsg, recv_mmsg): Print expected output in case of ENOSYS.
(main): Redirect stdout to a new descriptor.  Use LENGTH_OF.
Print expected output.
* tests/mmsg.test: Update.
* tests/mmsg.expected: Remove.
* tests/Makefile.am (EXTRA_DIST): Remove mmsg.expected.

8 years agoaio.test: check memory access by aio decoders
Dmitry V. Levin [Wed, 13 Jan 2016 22:06:18 +0000 (22:06 +0000)]
aio.test: check memory access by aio decoders

* tests/aio.c (main): Place all objects passed to io_* syscalls
at the end of memory pages followed by inaccessible pages.

8 years agos390, s390x: fix printing of syscalls unknown to the kernel
Dmitry V. Levin [Wed, 13 Jan 2016 20:53:41 +0000 (20:53 +0000)]
s390, s390x: fix printing of syscalls unknown to the kernel

On s390/s390x, syscalls with NR up to 255 can be implemented
directly using "svc NR", for NR >= 256 "svc 0" with %r1=NR is used.
The latter method is allowed for NR < 256, too.

When the syscall number specified directly or indirectly is recognized
by the kernel, i.e. it is less than its NR_syscalls value, it is stored
in %r2 and is available to arch_get_scno via s390_regset.gprs[2].
For syscall numbers >= NR_syscalls this register is set to 0,
but %r1 remains unchanged and could be used by arch_get_scno
via s390_regset.gprs[1] to decide what the syscall number is.

* linux/s390/get_scno.c (arch_get_scno): If s390_regset.gprs[2] is zero,
take syscall number from s390_regset.gprs[1].
* NEWS: Mention this fix.

This fixes Debian bug #485979 and Fedora bug #1298294.

8 years agos390, s390x: print all syscall arguments for syscall number 0
Dmitry V. Levin [Wed, 13 Jan 2016 20:51:42 +0000 (20:51 +0000)]
s390, s390x: print all syscall arguments for syscall number 0

* linux/s390/syscallent.h [0]: Set nargs to MA.
* linux/s390x/syscallent.h: Likewise.

8 years agomips o32: alias sys_syscall to printargs
Dmitry V. Levin [Wed, 13 Jan 2016 20:47:52 +0000 (20:47 +0000)]
mips o32: alias sys_syscall to printargs

* linux/dummy.h (sys_syscall): Alias to printargs.
* syscall.c [LINUX_MIPSO32] (SYS_FUNC(syscall)): Remove.

8 years agotravis-ci: update build matrix
Dmitry V. Levin [Wed, 13 Jan 2016 12:12:33 +0000 (12:12 +0000)]
travis-ci: update build matrix

Add clang-3.6/x86_64, clang-3.6/x86, and musl-gcc/x86_64 to the matrix.

* .travis.yml (compiler): Add gcc, clang-3.6, and musl-gcc.
(env): Add matrix, remove global ENABLE_GCC_WERROR.
(matrix): Add exclude, remove include.
* travis-ci.sh: Add support for clang and musl-gcc.
Use --enable-gcc-Werror for gcc build unconditionally.

8 years agompers.awk: add support for DWARF files generated by clang
Dmitry V. Levin [Wed, 13 Jan 2016 02:31:12 +0000 (02:31 +0000)]
mpers.awk: add support for DWARF files generated by clang

* mpers.awk: Define default_pointer_size.  Initialize byte_size
for DW_TAG_pointer_type to default_pointer_size.  Set parent
for DW_TAG_member only.  Handle DW_AT_count as an alternative
to DW_AT_upper_bound.

8 years agoconfigure.ac: reorder some statements for better readability
Dmitry V. Levin [Tue, 12 Jan 2016 21:27:36 +0000 (21:27 +0000)]
configure.ac: reorder some statements for better readability

* configure.ac: Sort and group together AC_PROG_*, AC_C_*, AC_TYPE_*,
AC_HEADER_*, AC_CHECK_FUNCS, AC_CHECK_TYPES, AC_CHECK_MEMBERS,
and AC_CHECK_HEADERS.

8 years agoscm_rights-fd.test: rewrite without fork
Dmitry V. Levin [Tue, 12 Jan 2016 14:47:12 +0000 (14:47 +0000)]
scm_rights-fd.test: rewrite without fork

* tests/scm_rights.c (main): Rewrite without fork.
Place all objects passed to sendmsg and recvmsg at the end
of memory pages followed by inaccessible pages.
* tests/scm_rights-fd.test: Update.

8 years agotests: fix clang "duplicate 'const' declaration specifier" warnings
Dmitry V. Levin [Tue, 12 Jan 2016 05:02:08 +0000 (05:02 +0000)]
tests: fix clang "duplicate 'const' declaration specifier" warnings

* tests/ksysent.c (pstr_t): Remove second const specifier.
* tests/mmsg.c (main): Remove second const specifier from one[], two[],
and three[].

8 years agotests/times.c: fix clang compilation warning
Dmitry V. Levin [Tue, 12 Jan 2016 04:27:22 +0000 (04:27 +0000)]
tests/times.c: fix clang compilation warning

* tests/times.c (main): Initialize dummy variable.

8 years agotests/mmsg.c: fix build on rhel6/ppc
Dmitry V. Levin [Tue, 12 Jan 2016 04:37:06 +0000 (04:37 +0000)]
tests/mmsg.c: fix build on rhel6/ppc

There are weird platforms that define __NR_sendmmsg but at the same time
do not define __NR_recvmmsg.  Add a workaround for them.

* configure.ac (AC_CHECK_FUNCS): Add recvmmsg.
* tests/mmsg.c: Check for __NR_recvmmsg || HAVE_RECVMMSG.