2015-03-06  Dmitry V. Levin  <ldv@altlinux.org>

	Prepare for 4.10 release.
	* NEWS: Update for 4.10 release.
	* debian/changelog: 4.10-1.
	* strace.spec: 4.10-1.

	Move sigreturn/rt_sigreturn parser to a separate file.
	* sigreturn.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (sprintsigmask_n): New prototype.
	(tprintsigmask_addr): New macro.
	* signal.c (sprintsigmask_n): Make global.
	(tprintsigmask_addr): Remove.
	(sys_sigreturn): Move to sigreturn.c.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: use PTRACE_GETREGS to fetch registers.
	* linux/ia64/arch_regs.h: Stop including <asm/rse.h>.
	(ia64_frame_ptr): New declaration.
	* signal.c (sys_sigreturn) [IA64]: Use ia64_frame_ptr.
	* syscall.c [IA64]: Include <asm/rse.h>.
	[IA64] (ia64_regs, ia64_frame_ptr): New variable.
	[IA64] (ARCH_REGS_FOR_GETREGS): New macro.
	[IA64] (ia64_ia32mode): Convert to macro.
	[IA64] (ia64_r8, ia64_r10): Remove.
	(getrval2, print_pc, get_scno, get_syscall_args, get_error) [IA64]:
	Use ia64_regs.
	(get_syscall_result) [IA64]: Remove.

	s390, s390x: use PTRACE_GETREGSET to fetch registers.
	* linux/s390/arch_regs.h: New file.
	* linux/s390x/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add them.
	* signal.c (sys_sigreturn) [S390 || S390X]: Use s390_frame_ptr.
	* syscall.c [S390 || S390X] (s390_regset, s390_frame_ptr): New variable.
	[S390 || S390X] (ARCH_REGS_FOR_GETREGSET): New macro.
	(print_pc) [S390 || S390X]: Use s390_regset.
	(get_scno) [S390 || S390X]: Likewise.
	(get_syscall_args) [S390 || S390X]: Likewise.
	(get_error) [S390 || S390X]: Likewise.
	(get_syscall_result) [S390 || S390X]: Remove.

	qemu_multiarch_testing: update.
	* qemu_multiarch_testing/README: Update statistics.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify unix-yy.test.
	Implement additional synchronization between parent and child processes
	to guarantee that the child starts closing connected socket only after
	exiting of the parent's accept() syscall.
	This guarantee seems to be necessary to reliably receive UNIX_DIAG_PEER
	messages from NETLINK_SOCK_DIAG interface.

	* tests/net-accept-connect.c: Implement additional synchronization
	between parent and child processes.
	* tests/unix-yy-connect.awk: Update.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	Use SIGRTMIN from kernel headers.
	* configure.ac (ASM_SIGRTMIN): Define to SIGRTMIN from <asm/signal.h>.
	* signal.c: Use ASM_SIGRTMIN instead of constants provided by libc.
	* tests/sigreturn.c: Use ASM_SIGRTMIN instead of hardcoded value.
	Use lower RT_* numbers to support pre-3.18 hppa kernels.
	* tests/sigreturn.test: Update regexp.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	ppc64: fix compilation warning.
	Fix compilation warning introduced by commit
	577be2593d4895ef941e1c4e5e1608f7dd13610d

	* signal.c (sys_sigreturn) [POWERPC64]: Fix initialization of signal
	mask on 32bit personality.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: fix compilation warnings.
	Fix compilation warnings introduced by commit
	5b9b7e1d347eb4556084cdccad75e8247c535ed5:

	signal.c:702:45: warning: signed and unsigned type in conditional expression [-Wsign-compare]
	syscall.c:746:34: warning: initialization from incompatible pointer type [enabled by default]

	* syscall.c [AARCH64] (aarch64_sp_ptr): Add explicit cast.
	[AARCH64] (arm_sp_ptr): Change pointer type to unsigned.
	* linux/aarch64/arch_regs.h (arm_sp_ptr): Update.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	i386: simplify sigreturn decoding.
	* signal.c (sys_sigreturn) [X86_64 || X32 || I386]: Do not define
	i386_sigcontext_struct and i386_fpstate structures.

2015-03-05  Dmitry V. Levin  <ldv@altlinux.org>

	tests: add a test for sigreturn/rt_sigreturn decoding.
	Convert test/sigreturn.c into a regular test.

	* test/Makefile (PROGS): Remove sigreturn.
	* test/.gitignore: Likewise.
	* test/sigreturn.c: Rewrite to ...
	* tests/sigreturn.c: ... new file.
	* tests/sigreturn.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add sigreturn.
	(TESTS): Add sigreturn.test.
	* tests/.gitignore: Add sigreturn.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	sigreturn: print signal mask as a syscall argument.
	Although sigreturn takes signal mask via frame pointer,
	it's more convenient to display signal mask as a syscall argument
	rather than an outstanding object of unknown nature:

	Before this change:
	    sigreturn() (mask [USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]) = 0

	After this change:
	    sigreturn({mask=[USR2 CHLD RT_2 RT_3 RT_4 RT_31 RT_32]}) = 0

	* signal.c (sys_sigreturn): Display signal mask as a syscall argument.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64: implement rt_sigreturn decoding.
	* linux/64/syscallent.h (139): Use sys_sigreturn for rt_sigreturn
	decoding.
	* syscall.c [ARM] (arm_regs): Make static.
	[ARM] (arm_sp_ptr): New variable.
	[AARCH64] (aarch64_sp_ptr, arm_sp_ptr): New variables.
	* linux/aarch64/arch_regs.h: New file.
	* linux/arm/arch_regs.h (arm_regs): Remove.
	(arm_sp_ptr): New declaration.
	* signal.c (sys_sigreturn) [ARM]: Use arm_sp_ptr.
	[AARCH64]: Print signal mask.

	arm: simplify sigreturn decoding.
	* signal.c (sys_sigreturn) [ARM]: Do not define sigcontext and ucontext
	structures, fetch signal mask only, use print_sigset_addr_len.

	s390: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [S390]: Fix signal mask decoding.

	mips o32: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [LINUX_MIPSO32]: Fix the address of signal mask.
	[MIPS] Use print_sigset_addr_len to print signal mask.

	x86_64, x32: implement rt_sigreturn decoding.
	* syscall.c [X86_64 || X32] (x86_64_rsp_ptr): New variable.
	* linux/x86_64/arch_regs.h (x86_64_rsp_ptr): New declaration.
	* linux/x86_64/syscallent.h (15): Use sys_sigreturn for rt_sigreturn
	decoding.
	* linux/x32/syscallent.h (513): Likewise.
	* signal.c (sys_sigreturn) [X86_64 || X32]: Print signal mask
	for non-i386 personalities.

	sparc, sparc64: fix sigreturn decoding.
	* linux/sparc/arch_regs.h (U_REG_FP): New macro.
	* signal.c (sys_sigreturn) [SPARC || SPARC64]: Fix decoding
	of upper 32 bits of the sigmask.

	ppc, ppc64: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [POWERPC]: Fix decoding of upper 32 bits
	of the sigmask.

	sigreturn: issue a less innocuous warning.
	* signal.c (sys_sigreturn): Issue a less innocuous warning on
	architectures for which signal mask decoding is not implemented yet.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	bootstrap: do not link Makefile* files.
	* bootstrap: Do not symlink any Makefile* files, not just Makefile.am
	and Makefile.in.

	Reported-by: Christopher Covington <cov@codeaurora.org>

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: fix sigreturn decoding.
	* signal.c (sys_sigreturn) [IA64]: Fix the address of signal mask.
	Use print_sigset_addr_len to print signal mask.

2015-03-04  Dmitry V. Levin  <ldv@altlinux.org>

	ia64: use generic signalent.
	This complements commit v4.9-321-gfcf7f8d.

	* linux/ia64/signalent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.

2015-03-04  Giedrius Statkevičius  <giedrius.statkevicius@gmail.com>

	Document that -k is available only with libunwind.
	Without this users might get confused why `man strace` describes
	an option that doesn't work.

	* strace.1: Note that -k is available only if strace is built
	with libunwind.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	debian: update control file.
	* debian/control (strace, strace-udeb): Add mips64 and mips64el
	to architecture list.
	Patch by James Cowgill <james410@cowgill.org.uk>

	This fixes Debian bug #773375.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	debian: sync with 4.9-2 package.
	* debian/changelog: Sync with 4.9-2.
	* debian/control: Likewise.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	Add arch-specific PTRACE_* constants.
	* xlat/ptrace_cmds.in: Add arch-specific ptrace commands.
	* xlat/ptrace_events.in: Add PTRACE_EVENT_MIGRATE for tile.
	* xlat/ptrace_setoptions_flags.in: Add PTRACE_O_TRACEMIGRATE for tile.

	This fixes Debian bug #734554.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	Clarify bootstrap-vs-autoreconf usage.
	* README-hacking: Tell people to run ./bootstrap.

2015-03-03  Dmitry V. Levin  <ldv@altlinux.org>

	mips n32: fix preadv/pwritev offset decoding.
	In mips n32 abi, like in most of 32-bit architectures, offset
	is passed to preadv/pwritev syscalls using two syscall arguments.

	* io.c (print_llu_from_low_high_val) [LINUX_MIPSN32]: Remove.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: skip ipc_sem.test on broken kernels.
	Rather than trigger an ERROR which fails `make check`, go with SKIP
	instead.  We don't want the testsuite failing due to kernel bugs.

	* tests/ipc_sem.c (main): Change 99 to 77.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: skip pc.test on s390.
	The s390 hardware can't support an exact si_addr, and the current kernels
	don't handle text addresses correctly at all.  Until that improves, skip
	the test on s390.

	* tests/pc.c (main): Return 77 on s390 systems.

2015-03-03  Mike Frysinger  <vapier@gentoo.org>

	tests: note the kernel configs for -yy options.
	* tests/net-yy.test: Note CONFIG_INET_TCP_DIAG.
	* tests/unix-yy.test: Note CONFIG_UNIX_DIAG.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	alpha: fix -yy decoding.
	* socketutils.c (receive_responses): Align buffer on a sizeof(long) boundary.

	Reported-and-tested-by: Mike Frysinger <vapier@gentoo.org>

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	aarch64, x32: fix decoding of compat personality statfs64/fstatfs64.
	* statfs.c (struct compat_statfs64) [AARCH64 || X32]: Apply the same
	attributes as on X86_64.

	mips: fix compilation warning.
	* syscall.c (get_scno) [MIPS]: Fix harmless compilation warning
	about comparison between signed and unsigned integer expressions.

	x32: fix compilation warnings.
	* sysinfo.c (sys_sysinfo): Use ll length format modifier
	instead of l and cast kernel ulong types to unsigned long long.

	aarch64: add -i option support.
	* syscall.c (print_pc): Add aarch64 support.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	ioctl: use x32 specific ioctl entries on x32 personality.
	As ioctls_inc.h generated natively on x32 differs both from 32/ioctls_inc.h
	(by 45 entries) and from linux/64/ioctls_inc.h (by 322 entries), use x32
	specific ioctl entries on x32 personality.

	* linux/x32/ioctls_inc0.h: Generate from linux v3.19 using ioctls_gen.sh.
	* linux/x86_64/ioctlent2.h: Remove.
	* linux/x86_64/ioctls_arch2.h: New file.
	* linux/x86_64/ioctls_inc2.h: New file.
	* Makefile.am (EXTRA_DIST): Remove linux/x86_64/ioctlent2.h, add
	linux/x86_64/ioctls_arch2.h and linux/x86_64/ioctls_inc2.h.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests/uid16: skip if real uid is larger than 16bit.
	* tests/uid16.c (main): Skip if the uid returned by getuid matches
	/proc/sys/kernel/overflowuid.

2015-03-02  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix uid tests on big endian architectures.
	* tests/uid.c (main): Ignore uids returned by getresuid to avoid
	16bit vs 32bit issues on big endian architectures.
	Change real UID instead of effective UID in setresuid test.
	* tests/uid16.c (main): Likewise.
	* tests/uid32.c (main): Change real UID instead of effective UID
	in setresuid test to match uid.c
	* tests/uid.awk: Update setresuid regexp.

	Reported-by: Mike Frysinger <vapier@gentoo.org>

2015-03-01  Mike Frysinger  <vapier@gentoo.org>

	tests/getdents: handle older getdents calls.
	If the tools we use call older getdents syscalls where d_type isn't
	passed back, or the arch is old (like Alpha) and can't pass back in
	either version, make sure we don't fail.

	* tests/getdents.awk (d_type_dir, d_type_reg): Accept DT_UNKNOWN.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix multiple personalities support in decoding syscall return values.
	* syscall.c (trace_syscall_exiting): When current personality is 32bit,
	print 32bit return code.

	Update generic 64-bit ioctlent from linux v3.19.
	* linux/64/ioctls_inc.h: Update from linux v3.19 using ioctls_gen.sh.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, sparc64: fix rt_sigaction decoding.
	Fix regression introduced by commit v4.9-9-gc3a5c01.

	* signal.c (HAVE_SA_RESTORER): New macro.
	[HPPA || IA64]: Do not undefine SA_RESTORER.
	(old_sigaction, old_sigaction32, new_sigaction): Use HAVE_SA_RESTORER
	instead of SA_RESTORER to check whether to define sa_restorer.
	(decode_old_sigaction, decode_new_sigaction): Use HAVE_SA_RESTORER in
	addition to SA_RESTORER to check whether to use sa_restorer.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	Fix stack buffer overflow when specified command is too long.
	* strace.c (startup_child): Check that the length of the command strace
	is going to execute does not exceed PATH_MAX limit.

	Reported-by: Cheolung Lee <chpie@grayhash.com>

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	build: include ptrace.h after regs.h.
	Restore the order of including <sys/reg.h> and <linux/ptrace.h>
	headers that was inadvertently changed by commit v4.9-280-g5503dd2.

	This should fix build on platforms like m68k where some constants
	are defined simultaneously as enums by <sys/reg.h> and as macros
	by <asm/ptrace.h>.

	* process.c: Include "ptrace.h" after "regs.h".
	* signal.c: Likewise.
	* syscall.c: Likewise.
	* util.c: Likewise.

2015-02-28  Dmitry V. Levin  <ldv@altlinux.org>

	x32: fix decoding of timeval, timespec, and timex structures.
	As time_t is a 64-bit type in x32 personality, it is not correct to
	treat it as a long int type.

	* time.c (current_time_t_is_compat): New macro.
	(sprinttv, sprint_timespec, printitv_bitness, tprint_timex): Use it.
	(tprint_timeval, do_sprinttv, sprint_timespec): Use j and uintmax_t
	when printing tv_sec/tv_usec.
	(tprint_timex): Use j and intmax_t/uintmax_t when printing struct timex
	members of type kernel_long_t.

2015-02-28  Mike Frysinger  <vapier@gentoo.org>

	tests/ipc_sem: detect broken kernels.
	When running 32bit ipc tests on ppc/sparc with a 64bit kernel, the ipc
	logic wrongly returns errors.  Detect that and throw an error.

	* tests/ipc_sem.c: Return 99 when errno is EFAULT.
	* tests/ipc_sem.test: Save output to $OUT and show it when failing.
	Handle exit status 99 to throw an ERROR.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	build: do not link strace with -ldl.
	* configure.ac: Fix dladdr check.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	Handle broken PTRACE_EVENT_STOP values.
	For a few linux releases (3.1 through 3.3), this define in the exported
	headers were broken.  Redefine if that's the case.

	* ptrace.h [PTRACE_EVENT_STOP]: Redefine if PTRACE_EVENT_STOP is 7.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	bootstrap: always set up test dirs.
	When files get updated, the bootstrap script should make sure the
	parallel dirs are kept in sync.

	* bootstrap: Always generate the test$m.  Clean up symlinks first.
	Don't link in Makefile.in files.

2015-02-27  Mike Frysinger  <vapier@gentoo.org>

	Fix cross-compiling of ioctlsort.
	Use the AX_PROG_CC_FOR_BUILD helper to set up build settings when cross
	compiling.  This way ioctlsort uses the build tools all the time.

	* configure.ac: Call AX_PROG_CC_FOR_BUILD.
	* Makefile.am (ioctlsort_CC): Set to CC_FOR_BUILD.
	(ioctlsort_CPPFLAGS): Change CPPFLAGS to CPPFLAGS_FOR_BUILD.
	(ioctlsort_CFLAGS): Change CFLAGS to CFLAGS_FOR_BUILD.
	(ioctlsort_LDFLAGS): Change LDFLAGS to LDFLAGS_FOR_BUILD.
	(ioctlsort_LD): Delete.
	(ioctlsort%): Change to ioctlsort%$(BUILD_EXEEXT).  Use ioctlsort_CFLAGS.
	* m4/ax_prog_cc_for_build.m4: Import from the autoconf-archive package.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify pc.test.
	* configure.ac: Check for dladdr in -ldl.
	* tests/Makefile.am (pc_LDADD): Adde $(dl_LIBS).
	* tests/pc.c: Include "config.h" and <dlfcn.h>.
	(main): Use dladdr to find the address to unmap.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	tests: drop support for alternative names of select syscall.
	This mostly reverts commit 4a00fc4867bde7a4c333f238851e5cb03f02c824.

	* tests/select.awk: Drop _newselect support.
	* tests/select.test: Skip if select syscall is not supported.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	Rename _newselect to select.
	As an exception to the general rules that syscall names should match
	__NR_* constants defined in kernel headers, show select as "select"
	and old select as "oldselect".

	* linux/arm/syscallent.h (82): Change name to oldselect.
	* linux/hppa/syscallent.h (142): Change name to select.
	* linux/mips/syscallent-n32.h (6022): Likewise.
	* linux/mips/syscallent-n64.h (5022): Likewise.
	* linux/mips/syscallent-o32.h (4142): Likewise.
	* linux/sparc/syscallent.h (230): Likewise.

2015-02-27  Dmitry V. Levin  <ldv@altlinux.org>

	sparc: sync syscall entries with kernel headers.
	* linux/sparc/syscallent.h: Fix syscall entries for vmsplice,
	inotify_init, inotify_add_watch, inotify_rm_watch, inotify_rm_watch,
	ioprio_set, ioprio_get, splice, sync_file_range, sched_getaffinity, and
	sched_setaffinity.
	(67, 68, 202, 230): Change syscall names to match __NR_* constants
	defined in arch/sparc/include/uapi/asm/unistd.h.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	s390, s390x: sync syscall entry names with kernel headers.
	* linux/s390/syscallent.h (1, 180, 181): Change syscall names to match
	__NR_* constants defined in arch/s390/include/uapi/asm/unistd.h.
	* linux/s390x/syscallent.h: Likewise.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	xlat: avoid fork bombing the build system.
	When there were fewer xlat headers, this didn't matter as much.
	But now with >200, trying to run them all in parallel can easily
	fork bomb smaller systems.

	* xlat/gen.sh (main): Do not more jobs than # of cpus.

2015-02-26  Dmitry V. Levin  <ldv@altlinux.org>

	arm: sync syscall entry names with kernel.
	* linux/arm/syscallent.h (82, 90, 180, 181, 327):
	Change syscall names to match __NR_* constants defined
	in arch/arm/include/uapi/asm/unistd.h.

	arm: fix get_mempolicy, set_mempolicy, and timerfd_create syscall entries
	* linux/arm/syscallent.h (320, 321, 350): Fix names and handlers.

	hppa: sync syscall entry names with kernel.
	* linux/hppa/syscallent.h (18, 28, 59, 84, 108, 109, 280):
	Change syscall names to match __NR_* constants defined in
	arch/parisc/include/uapi/asm/unistd.h.

	subcall.h: add sendmmsg entry.
	* linux/subcall.h: Add sys_sendmmsg entry.
	(SYS_socket_nsubcalls): Update.

	arm: simplify ARM_FIRST_SHUFFLED_SYSCALL definition.
	* linux/arm/syscallent.h (ARM_FIRST_SHUFFLED_SYSCALL): Use SYS_ipc_subcall.

	ia64: parametrize i386 syscallent size check.
	* linux/ia64/syscallent.h: Use (SYS_ipc_subcall + SYS_ipc_nsubcalls)
	instead of numeric constant.

	Cleanup linux/subcall.h.
	* linux/subcall.h: Use SYS_ipc_subcall.

	alpha: fix statfs decoding.
	* statfs.c (printstatfs) [ALPHA]: Remove faulty code.

	x32: fix build regression.
	* linux/x32/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	hppa: fix fanotify_mark decoding.
	The parisc kernel has some legacy baggage here and decodes the 64bit
	field in the reverse order.  Handle it in strace too.

	* fanotify.c [HPPA] (sys_fanotify_mark): Reverse the mask bits.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ia64: fix decoding of getresuid/getresgid/setresgid.
	Looks like the similarity of these names caused confusion when generating
	the syscall table.  getresgid was wired to the wrong output while the other
	two were wired up to printargs instead of the real printer.

	* linux/ia64/syscallent.h: Connect getresuid to sys_getresuid, getresgid to
	sys_getresgid, and setresgid to sys_setresgid.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ia64: fix up builds after 16bit uid support.
	The ia64 port pulls in the i386 syscall table so it can decode
	32bit apps, so we need to enable the 16bit uid parsers for it.

	* defs.h (NEED_UID16_PARSERS): Define to 1 for IA64.
	* linux/ia64/syscallent.h: Undefine sys_stime to avoid redefine warnings.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	v4l2: use uintmax_t for times.
	There is no guarantee that the backing value for the various time fields
	are ints or longs which makes printfs annoying.  Lets cast them to the
	uintmax_t type so we can use the j flag and not worry about truncation.

	* v4l2.c (v4l2_ioctl): Use j and uintmax_t when printing tv_sec/tv_usec.

2015-02-26  Mike Frysinger  <vapier@gentoo.org>

	ignore core/compile files.
	Newer autotools includes a compile helper script.

	* .gitignore: Add /compile and core.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	NEWS: Prepare for 4.10 release.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	Remove support for systems without PTRACE_SETOPTIONS.
	Assume that the kernel is v2.5.46 or newer, i.e. PTRACE_SETOPTIONS
	and PTRACE_O_TRACESYSGOOD|PTRACE_O_TRACEEXEC|PTRACE_O_TRACECLONE
	are universally available.

	This change removes all code that implemented post-execve SIGTRAP
	handling and fork/vfork/clone->CLONE_PTRACE substitution.

	* defs.h (TCB_BPTSET, TCB_WAITEXECVE): Remove macros.
	(need_fork_exec_workarounds, setbpt, clearbpt): Remove declarations.
	* strace.c (need_fork_exec_workarounds,
	test_ptrace_setoptions_followfork, test_ptrace_setoptions_for_all):
	Remove.
	(syscall_trap_sig): Set to (SIGTRAP | 0x80).
	(ptrace_setoptions): Set to (PTRACE_O_TRACESYSGOOD | PTRACE_O_TRACEEXEC).
	(detach): Do not test for TCB_BPTSET.
	(init): Do not call test_ptrace_setoptions_followfork and
	test_ptrace_setoptions_for_all.  Do not test for TCB_BPTSET.
	* syscall.c (syscall_fixup_on_sysenter, internal_fork, internal_exec,
	syscall_fixup_for_fork_exec, syscall_fixup_on_sysexit): Remove.
	(trace_syscall_entering): Do not test for TCB_WAITEXECVE.  Do not call
	syscall_fixup_on_sysenter and syscall_fixup_for_fork_exec.
	(trace_syscall_exiting): Do not call syscall_fixup_on_sysexit and
	syscall_fixup_for_fork_exec.
	[IA64] (ia64_ia32mode): Make static.
	* linux/ia64/arch_regs.h (ia64_ia32mode): Remove declaration.
	* util.c: Do not include "syscall.h".
	(arg_setup, get_arg0, get_arg1, set_arg0, set_arg1, restore_arg0,
	restore_arg1, arg_finish_change, change_syscall, setbpt, clearbpt):
	Remove.
	* tests/ptrace_setoptions.test: Remove.
	* tests/Makefile.am (TESTS): Remove it.

2015-02-24  Dmitry V. Levin  <ldv@altlinux.org>

	tests: robustify pc.test.
	* tests/pc.c (main): Unmap larger memory region.
	Dump process map for debug purposes.
	* tests/pc.test: Update regexps to take CLD_DUMPED child process
	into account.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	tests: fix "make dist" regression.
	* tests/Makefile.am (EXTRA_DIST): Add getrandom.awk.

	tests: workaround broken awk.
	* tests/getdents.out: New file.
	* tests/Makefile.am (EXTRA_DIST): Add it.
	* tests/getdents.test: Check whether awk is capable of matching long
	regular expressions.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	Fix compilation warnings about incompatible print formats.
	On some platforms printing of __s64 types with "%lld" format,
	or __u64 types with "%llu" or "%llx" formats causes a warning
	that __s64/__u64 type is not compatible with long long format.
	From my PoV, this is nonsense, but the workaround costs nothing.

	* scsi.c (print_sg_io_v4_req, print_sg_io_v4_res): Cast __u64 types
	to (unsigned long long).
	* v4l2.c (v4l2_ioctl): Likewise.  Cast __s64 type to (long long).

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	powerpc64: fix build regression.
	* linux/powerpc64/arch_regs.h: New file.
	* Makefile.am (EXTRA_DIST): Add it.

	signalent: update from linux v3.19.
	* linux/alpha/signalent.h: Update from linux v3.19 signalent.sh.
	* linux/hppa/signalent.h: Likewise.
	* linux/mips/signalent.h: Likewise.
	* linux/sparc/signalent.h: Likewise.

	Cleanup auxiliary signalent files.
	* linux/aarch64/signalent1.h: Include "signalent.h".
	* linux/powerpc64/signalent1.h: Likewise.
	* linux/sparc64/signalent2.h: Likewise.
	* linux/tile/signalent1.h: Likewise.
	* linux/x32/signalent1.h: Likewise.
	* linux/x86_64/signalent1.h: Likewise.
	* linux/x86_64/signalent2.h: Likewise.
	* linux/sparc64/signalent.h: Include "sparc/signalent.h".
	* linux/sparc64/signalent1.h: Include "sparc/signalent1.h".
	* linux/x32/signalent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove linux/x32/signalent.h.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	x86_64, x32: fix sys_sigreturn.
	On x86_64/x32, sys_sigreturn is defined only for i386 personality.

	* signal.c (sys_sigreturn): Define for X32.
	(sys_sigreturn) [X86_64 || X32]: Implement for i386 personality only.

2015-02-23  Dmitry V. Levin  <ldv@altlinux.org>

	sparc, x32: fix build regression.
	* syscall.c (print_pc): Use current_wordsize iff it is defined.

	Change errnoent.h files to use designated initializers.
	* signal.c (printsiginfo): Allow elements of errnoent array to be zero.
	* syscall.c (trace_syscall_exiting): Likewise.
	* errnoent.sh: Output designated initializers.
	* linux/errnoent.h: Regenerated.
	* linux/alpha/errnoent.h: Regenerated.
	* linux/hppa/errnoent.h: Regenerated.
	* linux/mips/errnoent.h: Regenerated.
	* linux/sparc/errnoent.h: Regenerated.
	* linux/sparc/errnoent1.h: Regenerated.
	* linux/powerpc/errnoent.h: New file.
	* linux/powerpc64/errnoent.h: Include "powerpc/errnoent.h".
	* Makefile.am (EXTRA_DIST): Add linux/powerpc/errnoent.h
	and linux/powerpc64/errnoent.h.

	errnoent: update from linux v3.19.
	* linux/errnoent.h: Update from linux v3.19 using errnoent.sh.
	* linux/alpha/errnoent.h: Likewise.
	* linux/hppa/errnoent.h: Likewise.
	* linux/mips/errnoent.h: Likewise.
	* linux/sparc/errnoent.h: Likewise.

	Cleanup auxiliary errnoent files.
	* linux/aarch64/errnoent1.h: Include "errnoent.h".
	* linux/powerpc64/errnoent1.h: Likewise.
	* linux/sparc64/errnoent2.h: Likewise.
	* linux/tile/errnoent1.h: Likewise.
	* linux/x32/errnoent1.h: Likewise.
	* linux/x86_64/errnoent1.h: Likewise.
	* linux/x86_64/errnoent2.h: Likewise.
	* linux/sparc64/errnoent.h: Include "sparc/errnoent.h".
	* linux/sparc64/errnoent1.h: Include "sparc/errnoent1.h".
	* linux/x32/errnoent.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove linux/x32/errnoent.h.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	evdev: update constants from linux v3.19.
	* xlat/evdev_keycode.in: Update from linux v3.19.
	* xlat/evdev_prop.in: Likewise.

	evdev: decode keycode value in EVIOC[GS]KEYCODE_V2 commands.
	* evdev.c (keycode_V2_ioctl): Use evdev_keycode to print
	input_keymap_entry.keycode.

	evdev: fix build with old kernel headers.
	* configure.ac: Check whether struct input_absinfo.resolution is defined
	in <linux/input.h>.
	* evdev.c (SYN_MAX): Add fallback definition.
	(abs_ioctl): Wrap use of struct input_absinfo.resolution in #ifdef check.
	(keycode_V2_ioctl, mtslots_ioctl, repeat_ioctl): Wrap in #ifdef checks.
	(evdev_read_ioctl): Wrap in #ifdef checks the code that uses EV_SW,
	EVIOCGREP, EVIOCGKEYCODE_V2, EVIOCGMTSLOTS, EVIOCGPROP, and EVIOCGSW.
	(evdev_write_ioctl): Wrap in #ifdef checks the code that uses EVIOCSREP,
	EVIOCSKEYCODE_V2, EVIOCSCLOCKID, and EVIOCREVOKE.

2015-02-22  Etienne Gemsa  <etienne.gemsa@lse.epita.fr>

	Add decoding for evdev ioctls.
	This patch introduces decoding for evdev ioctls.  For EVIOCSFF the five
	first members are decoded, the union is not.  The code was compiled and
	tested on x86_64 with Linux 3.13.

	* evdev.c: New file.
	* Makefile.am (strace_SOURCES): Add it.
	* defs.h (evdev_ioctl): New prototype.
	* ioctl.c (ioctl_decode): Call evdev_ioctl for 'E' ioctl commands.
	* xlat/evdev_autorepeat.in: New file.
	* xlat/evdev_ff_status.in: New file.
	* xlat/evdev_ff_types.in: New file.
	* xlat/evdev_keycode.in: New file.
	* xlat/evdev_leds.in: New file.
	* xlat/evdev_misc.in: New file.
	* xlat/evdev_mtslots.in: New file.
	* xlat/evdev_prop.in: New file.
	* xlat/evdev_relative_axes.in: New file.
	* xlat/evdev_snd.in: New file.
	* xlat/evdev_switch.in: New file.
	* xlat/evdev_sync.in: New file.

2015-02-22  Dmitry V. Levin  <ldv@altlinux.org>

	Fix build with old kernel headers.
	* strace.c (print_debug_info, maybe_allocate_tcb, print_signalled,
	print_exited): Remove "const" qualifier from status variable to
	workaround some old implementations of WIFSIGNALED/WIFSTOPPED/WIFEXITED
	macros.
	* v4l2.c: Include <linux/types.h>.
	(v4l2_ioctl): Check that V4L2_CTRL_FLAG_NEXT_CTRL and VIDIOC_S_EXT_CTRLS
	macros are defined.
	* tests/Makefile.am (AM_CPPFLAGS): Define.

	Fix "make dist" regression.
	* Makefile.am (EXTRA_DIST): Remove README-linux.

2015-02-20  Elliott Hughes  <enh@google.com>

	test/sfd.c: add missing includes.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Remove linux/fanotify.h.
	* linux/fanotify.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* fanotify.c: Do not include <linux/fanotify.h>.
	* xlat/fan_classes.in: Add default values.
	* xlat/fan_event_flags.in: Likewise.
	* xlat/fan_init_flags.in: Likewise.
	* xlat/fan_mark_flags.in: Likewise.

	Remove linux/keyctl.h.
	* linux/keyctl.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* keyctl.c: Do not include <linux/keyctl.h>.
	* xlat/key_perms.in: Add default values.
	* xlat/key_reqkeys.in: Likewise.
	* xlat/key_spec.in: Likewise.
	* xlat/keyctl_commands.in: Likewise.

	Remove linux/kexec.h.
	* linux/kexec.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* kexec.c: Do not include <linux/kexec.h>.
	* xlat/kexec_arch_values.in: Add default values.
	* xlat/kexec_flags.in: Rename to kexec_load_flags.in, add default
	values.

	Remove linux/inotify.h.
	* linux/inotify.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* inotify.c: Do not include <linux/inotify.h>.
	* xlat/inotify_flags.in: Add default values.

	Remove linux/reboot.h.
	* linux/reboot.h: Remove.
	* Makefile.am (EXTRA_DIST): Remove it.
	* reboot.c: Do not include <linux/reboot.h>.
	* xlat/bootflags1.in: Add default values.
	* xlat/bootflags2.in: Likewise.
	* xlat/bootflags3.in: Likewise.

	seccomp: fix fallback definitions of some SECCOMP_* constants.
	* seccomp.c (SECCOMP_SET_MODE_STRICT, SECCOMP_SET_MODE_FILTER,
	SECCOMP_FILTER_FLAG_TSYNC): Remove fallback definitions.
	* xlat/seccomp_filter_flags.in: Add default value.
	* xlat/seccomp_ops.in: Add default values.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	is_negated_errno: sync MAX_ERRNO with the kernel.
	Linux kernel used to guarantee that the largest errno value will not
	exceed 4095, but SECCOMP_RET_ERRNO support introduced by kernel commit
	v3.4-rc2-13-gacf3b2c71ed20c53dc69826683417703c2a88059 inadvertently
	broke it.  The guarantee is back with kernel commit
	v3.19-8275-g580c57f1076872ebc2427f898b927944ce170f2d.

	* syscall.c (is_negated_errno): Set maximum errno value to 4095.

2015-02-19  Mike Frysinger  <vapier@gentoo.org>

	README-linux: punt.
	Considering we're requiring linux-2.6 era kernels, the discussion of
	header troubles that plagued 2.2 and 2.4 are no longer relevant.

	* README-linux: Delete.

2015-02-19  Dmitry V. Levin  <ldv@altlinux.org>

	Improve prctl decoding.
	* configure.ac (AC_CHECK_HEADERS): Add linux/securebits.h.
	* prctl.c (sys_prctl): Implement full decoding of all PR_* constants
	as defined in linux v3.19.
	(sys_arch_prctl): Fix decoding of unknown commands.
	* xlat/cap.in: New file.
	* xlat/pr_mce_kill.in: New file.
	* xlat/pr_mce_kill_policy.in: New file.
	* xlat/pr_set_mm.in: New file.
	* xlat/pr_tsc.in: New file.
	* xlat/pr_unalign_flags.in: New file.
	* xlat/secbits.in: New file.
	* xlat/prctl_options.in: Remove non-linux constants, add fallback
	definitions.
	* xlat/seccomp_mode.in: Add fallback definitions.

	xlat: extend syntax.
	* xlat/gen.sh (gen_header): If the name of constant is specified with a
	value, generate a default definition for the constant using this value.
	* xlat/timerfdflags.in: Use extended syntax.

	Move CAP_* definitions out to header files.
	* Makefile.am (strace_SOURCES): Add caps0.h and caps1.h.
	* caps0.h: New file.
	* caps1.h: New file.
	* capability.c: Remove CAP_* definitions, include "caps0.h"
	and "caps1.h" instead.
	Include "xlat/cap_mask0.h" instead of "xlat/capabilities.h".
	Include "xlat/cap_mask1.h" instead of "xlat/capabilities1.h".
	(print_cap_bits): Update callers.
	* xlat/capabilities.in: Rename to xlat/cap_mask0.in.
	* xlat/capabilities1.in: Rename to xlat/cap_mask1.in.

2015-02-18  Dmitry V. Levin  <ldv@altlinux.org>

	Declare all format printers with printf format attribute.
	* defs.h (printllval, printnum_int, printnum_long): Mark with
	format(printf) attribute.
	* sock.c (sock_ioctl): Fix format string.

2015-02-17  Dmitry V. Levin  <ldv@altlinux.org>

	Rename printnum to printnum_long to avoid confusion.
	* defs.h (printnum): Rename to printnum_long.
	* util.c (printnum): Likewise.
	* process.c (sys_ptrace): Likewise.
	* time.c (sys_time): Likewise.

	Use printnum_int consistently.
	* sock.c (sock_ioctl): Use printnum_int instead of printnum to print
	integer type.
	* stream.c (sys_getpmsg): Likewise.

2015-02-16  Dmitry V. Levin  <ldv@altlinux.org>

	print_pc: fix multiple personalities support.
	* syscall.c (print_pc): Choose instruction pointer format depending
	on current_wordsize, not the size of long integer type.
	* tests/pc.c: New file.
	* tests/pc.test: New test.
	* tests/Makefile.am (check_PROGRAMS): Add pc.
	(TESTS): Add pc.test.
	* tests/.gitignore: Add pc.

	mips: use PTRACE_GETREGS to fetch all registers.
	* linux/mips/arch_regs.h (struct mips_regs): New structure.
	(mips_REG_*): New macros.
	* signal.c (sys_sigreturn) [MIPS]: Use mips_REG_SP.
	* syscall.c [MIPS] (struct mips_regs): New variable.
	[MIPS] (ARCH_REGS_FOR_GETREGS): New macro.
	(mips_a3, mips_r2): Remove.
	(print_pc) [MIPS]: Use mips_REG_EPC.
	(get_scno) [MIPS]: Use mips_REG_V0 and mips_REG_A3.
	(get_syscall_args) [MIPS]: Use mips_REG_A[0-5].
	(get_syscall_result) [MIPS]: Remove.
	(get_error) [MIPS]: Use mips_REG_A3 and mips_REG_V0.

	mips: move ABI check to configure.ac.
	* configure.ac [MIPS]: Check for MIPS ABI.
	* defs.h [MIPS]: Remove MIPS ABI check.
	* ioctlsort.c: Likewise.

	tests: support alternative names of select syscall.
	* tests/select.awk: Recognize "_newselect" as another name of "select".
	* tests/select.test: Try alternative names of select syscall.

2015-02-15  Dmitry V. Levin  <ldv@altlinux.org>

	i386: fix compilation warning.
	Some gcc versions complain about assigning long* to uint32_t* on i386.

	* syscall.c [I386] (i386_esp_ptr): Change type from uint32_t* to long*.
	* linux/i386/arch_regs.h (i386_esp_ptr): Likewise.
	* linux/x86_64/arch_regs.h: Do not include "i386/arch_regs.h".
	(i386_esp_ptr): New prototype.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	Do not reset get_regs_error unnecessarily.
	As get_regs() is now guaranteed to set get_regs_error,
	there is no need to reset get_regs_error before get_regs() call.

	* strace.c (trace): Call clear_regs() iff !WIFSTOPPED.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	get_syscall_result: remove redundant ifdefs.
	As get_regs() is now guaranteed to fetch registers when either
	ARCH_REGS_FOR_GETREGSET or ARCH_REGS_FOR_GETREGS is defined, we can
	safely replace all checks for architectures where these macros are defined
	with a single check for these macros.

	* syscall.c (get_syscall_result): Check for [ARCH_REGS_FOR_GETREGSET ||
	ARCH_REGS_FOR_GETREGS].  Remove all checks for architectures where
	nothing has to be done after get_regs().

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	get_regs: define for all architectures.
	* defs.h (get_regs_error): Remove.
	(clear_regs): Update prototype, declare unconditionally.
	(get_regs): Declare unconditionally.
	* syscall.c (clear_regs): New function.
	(get_regs): Define unconditionally.
	(get_regs_error): Define unconditionally, change scope to static.

	get_regs: unify code for architectures that use PTRACE_GETREGS.
	* syscall.c [I386, POWERPC, ARM, AVR32, SPARC, SPARC64, TILE]
	(ARCH_REGS_FOR_GETREGS): New macro.
	(get_regs): Unify code for ARCH_REGS_FOR_GETREGS architectures.

	get_regset: define iff PTRACE_GETREGSET is used.
	* syscall.c [AARCH64, X86_64, X32] (ARCH_REGS_FOR_GETREGSET,
	ARCH_IOVEC_FOR_GETREGSET): New macros.
	(get_regset): Define iff ARCH_REGS_FOR_GETREGSET is defined; change
	return type to long, return ptrace() return code instead of assigning it
	to get_regs_error; do not list individual architectures, implement
	constant and variable iovec cases depending on ARCH_IOVEC_FOR_GETREGSET.
	(get_regs): Assign get_regset() return code to get_regs_error.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>

	arm, i386: switch back to use PTRACE_GETREGS.
	PTRACE_GETREGSET and PTRACE_GETREGS methods are equally good on arm and
	i386 architectures, but PTRACE_GETREGSET with fallback to PTRACE_GETREGS
	is a bit more costly, so choose the method that costs less.
	This partially reverts commit v4.7-149-gfaa177e.

	* syscall.c [ARM, I386] (ARCH_REGS_FOR_GETREGSET): Remove.
	(get_regset) [ARM || I386]: Remove.
	(get_regs) [ARM || I386]: Use PTRACE_GETREGS unconditionally.

2015-02-14  Dmitry V. Levin  <ldv@altlinux.org>
