Snap for 4620899 from d442ef3c4a2bd22aa2daf50d96007e5245422f49 to pi-release

Change-Id: I8dad3369950d08b32d2c066d0e234b8d8de5159c
diff --git a/.strace.1.in.date b/.strace.1.in.date
new file mode 100644
index 0000000..d749583
--- /dev/null
+++ b/.strace.1.in.date
@@ -0,0 +1 @@
+2018-02-11
diff --git a/.tarball-version b/.tarball-version
new file mode 100644
index 0000000..1fda809
--- /dev/null
+++ b/.tarball-version
@@ -0,0 +1 @@
+4.21
diff --git a/.version b/.version
new file mode 100644
index 0000000..1fda809
--- /dev/null
+++ b/.version
@@ -0,0 +1 @@
+4.21
diff --git a/.year b/.year
new file mode 100644
index 0000000..b39a36a
--- /dev/null
+++ b/.year
@@ -0,0 +1 @@
+2018
diff --git a/Android.bp b/Android.bp
index 9474ba8..9cd55f5 100644
--- a/Android.bp
+++ b/Android.bp
@@ -52,6 +52,7 @@
         "fchownat.c",
         "fcntl.c",
         "fetch_bpf_fprog.c",
+        "fetch_indirect_syscall_args.c",
         "fetch_struct_flock.c",
         "fetch_struct_keyctl_kdf_params.c",
         "fetch_struct_mmsghdr.c",
@@ -69,6 +70,7 @@
         "futex.c",
         "getcpu.c",
         "getcwd.c",
+        "getpagesize.c",
         "getrandom.c",
         "get_robust_list.c",
         "hdio.c",
@@ -88,6 +90,7 @@
         "kcmp.c",
         "kexec.c",
         "keyctl.c",
+        "kvm.c",
         "ldt.c",
         "link.c",
         "listen.c",
diff --git a/CREDITS b/CREDITS
index f2e099a..7f77138 100644
--- a/CREDITS
+++ b/CREDITS
@@ -40,6 +40,7 @@
 	Cai Fei <caifei@cn.fujitsu.com>
 	Carlos O'Donell <carlos@systemhalted.org>
 	Carmelo Amoroso <carmelo.amoroso@st.com>
+	Chen Jingpiao <chenjingpiao@gmail.com>
 	Cheolung Lee <chpie@grayhash.com>
 	Chris Dearman <chris.dearman@imgtec.com>
 	Chris Metcalf <cmetcalf@tilera.com>
@@ -48,6 +49,7 @@
 	Christian Svensson <blue@cmd.nu>
 	Christopher Covington <cov@codeaurora.org>
 	D.J. Barrow <djbarrow@de.ibm.com>
+	DJ Delorie <dj@redhat.com>
 	Damien Profeta <damien.profeta@amadeus.com>
 	Damir Shayhutdinov <damir@altlinux.org>
 	Daniel P. Berrange <berrange@redhat.com>
@@ -66,7 +68,7 @@
 	Edgar E. Iglesias <edgar.iglesias@gmail.com>
 	Edgar Kaziakhmedov <edgar.kaziakhmedov@virtuozzo.com>
 	Elliott Hughes <enh@google.com>
-	Elvira Khabirova <lineprinter0@gmail.com>
+	Elvira Khabirova <lineprinter@altlinux.org>
 	Erik Johansson <erik@ejohansson.se>
 	Etienne Gemsa <etienne.gemsa@lse.epita.fr>
 	Eugene Syromyatnikov <evgsyr@gmail.com>
@@ -89,6 +91,7 @@
 	Greg Banks <gbanks@pocketpenguins.com>
 	H.J. Lu <hongjiu.lu@intel.com>
 	Harald van Dijk <truedfx@gentoo.org>
+	Harsha Sharma <harshasharmaiitr@gmail.com>
 	Heiko Carstens <heiko.carstens@de.ibm.com>
 	Helge Deller <deller@gmx.de>
 	Henrik Storner <storner@osiris.ping.dk>
@@ -104,7 +107,6 @@
 	JayRJoshi <jay.r.joshi100@gmail.com>
 	Jeff Mahoney <jeffm@suse.com>
 	Jian Zhen <zhenjl@gmail.com>
-	JingPiao Chen <chenjingpiao@gmail.com>
 	Jiri Slaby <jirislaby@gmail.com>
 	Joakim Bech <joakim.bech@linaro.org>
 	Joe Ilacqua <spike@world.std.com>
@@ -184,6 +186,7 @@
 	Robin Hack <hack.robin@gmail.com>
 	Roland Borde <bo@uebemc.siemens.de>
 	Roland McGrath <roland@redhat.com>
+	Rolf Eike Beer <eb@emlix.com>
 	Romain Naour <romain.naour@smile.fr>
 	Sami Farin <safari@u.safari.iki.fi>
 	Sandhya Bankar <bankarsandhya512@gmail.com>
@@ -215,6 +218,7 @@
 	Vicente Olivert Riera <vincent@gentoo.org>
 	Victor Krapivensky <krapivenskiy.va@phystech.edu>
 	Vineet Gupta <Vineet.Gupta1@synopsys.com>
+	Vitaly Chaykovsky <mgspeker@gmail.com>
 	Wang Chao <wang.chao@cn.fujitsu.com>
 	Weichuan Yan <wchyan@marvell.com>
 	Wichert Akkerman <wichert@deephackmode.org>
diff --git a/ChangeLog b/ChangeLog
index 988b70b..ca54bd7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,3258 @@
+2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Prepare for 4.21 release.
+	* NEWS: Update for 4.21 release.
+
+	Update copyright headers.
+	Headers updated automatically using maint/update_copyright_years.sh
+	script.
+
+2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Remove old and unused maintenance scripts.
+	Firewell, last witnesses of bygone era.
+
+	* linux/sparc/gen.pl: Remove.
+	* linux/x86_64/gentab.pl: Likewise.
+	* xlate.el: Likewise.
+	* Makefile.am (EXTRA_DIST): Remove them.
+
+	Suggested-by: Elvira Khabirova <lineprinter@altlinux.org>
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-02-13  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Consistently use MAX_ERRNO_VALUE.
+	* filter_qualify.c (parse_inject_token): Replace 4095
+	with MAX_ERRNO_VALUE.
+	* negated_errno.h (is_negated_errno): Likewise.  Remove redundant
+	comment.
+
+	Export SIZEOF_LONG and SIZEOF_KERNEL_LONG_T to tests.
+	* configure.ac (AC_SUBST): Add SIZEOF_LONG and SIZEOF_KERNEL_LONG_T.
+	* tests/Makefile.am (SIZEOF_LONG, SIZEOF_KERNEL_LONG_T): New variables.
+	(AM_TEST_LOG_FLAGS): Pass them.
+	* bootstrap: Substitute them.
+
+2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: avoid ioctl_kvm_run test failure when built with gcc -O0.
+	When built with -O0, gcc (rightfully) generates function prologue, which
+	results in writing %rbp to the stack, causing premature KVM_EXIT_MMIO.
+	It could be possible to avoid such problems by "naked" attribute but,
+	unfortunately, the latter is not available on x86 with older GCC.
+	A trick suggested in [1] is used instead: assembly is moved
+	to the global scope.
+
+	[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=50242#c3
+
+	* tests/ioctl_kvm_run.c (code): Remove function.
+	Add globally scoped __asm__ with the function code and its size.
+	(code, code_size): New extern symbols declarations.
+	(run_kvm): Remove code_size definition and initialization.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests/ioctl_kvm_run.c: add KVM_EXIT_MMIO diagnostics.
+	As it has proven itself useful.
+
+	* tests/ioctl_kvm_run.c (run_kvm) <case KVM_EXIT_MMIO:>: Fail
+	on unexpected KVM_EXIT_MMIO, providing relevant diagnostics.
+
+2018-02-13  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: add compatibility layer for accept call.
+	Recent glibc (since version 2.26) uses accept4 syscall for implementing
+	accept call on sparc.  Unfortunately, it's impossible to simply fall
+	back on raw syscall as it had not been wired up until linux commit
+	v4.4-rc8~4^2~1.
+
+	* tests/accept_compat.h: New file.
+	* tests/Makefile.am (EXTRA_DIST): Add it.
+	* tests/net-y-unix.c: Include accept_compat.h, use do_accept()
+	instead of accept() calls.
+	* tests/net-yy-inet.c: Likewise.
+	* tests/net-yy-unix.c: Likewise.
+	* tests/net.expected: Allow accept4.
+
+2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>
+
+	debian: build strace-udeb separately.
+	* debian/rules (extra_build_targets): Add build-udeb-stamp.
+	(build-udeb/Makefile): New rule.
+	(clean): Remove build-udeb.
+	* debian/strace-udeb.install: Update.
+
+	Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=826223
+
+2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Enable symbol demangling in deb- and rpm-driven builds.
+	* debian/control (Build-Depends) [amd64]: Add libiberty-dev.
+	* strace.spec.in (buildrequires_libunwind_devel): Add binutils-devel.
+
+2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>
+
+	debian: re-enable -k option on x86_64.
+	This partially reverts commit v4.13~177.
+
+	* debian/control (Build-Depends) [amd64]: Add libunwind-dev.
+
+2018-02-12  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Add "strace -V" output to build log.
+	* strace.spec.in (%check): Print "strace -V" output before
+	running the test suite.
+	* debian/rules (%-stamp): Likewise.
+
+2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	xlat: update NT_* constants.
+	* xlat/nt_descriptor_types.in (NT_PPC_PKEY): New constant introduced
+	by linux kernel commit v4.16-rc1~93^2~72.
+
+	Update the list of PKEY_* constants.
+	* xlat/pkey_access.in (PKEY_DISABLE_EXECUTE): New constant introduced
+	by linux kernel commit v4.16-rc1~93^2~85.
+	* tests/pkey_alloc.c: Update expected output.
+	* NEWS: Mention it.
+
+	powerpc, powerpc64: wire up pkey_* syscalls.
+	* linux/powerpc/syscallent.h [384..386]: Add pkey_alloc,
+	pkey_free, and pkey_mprotect syscalls introduced by linux kernel
+	commits v4.16-rc1~93^2~70 and v4.16-rc1~93^2~69, respectively.
+	* linux/powerpc64/syscallent.h: Likewise.
+	* NEWS: Mention it.
+
+	Update NEWS.
+
+2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	linux/ia64: remove IA-32 mode support.
+	There is no compat support in strace and there are no systems
+	within reach that would allow to test it.
+
+	* linux/ia64/arch_regs.c (IA64_PSR_IS, ia64_ia32mode): Remove.
+	* linux/ia64/get_error.c (get_error): Remove ia64_ia32mode branch.
+	* linux/ia64/get_scno.c (arch_get_scno): Likewise.
+	* linux/ia64/get_syscall_args.c (get_syscall_args): Likewise.
+	* linux/ia64/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/ia64/set_scno.c (arch_set_scno): Likewise.
+
+2018-02-12  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: parse return code second time after injecting.
+	In order to have the same view as tracee has, with regards to
+	"never fail" syscalls.
+
+	* syscall.c (tamper_with_syscall_exiting): Call get_error after the
+	return value tampering to re-initialise u_rval and u_error fields
+	of struct tcb.
+
+2018-02-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	sparc: mark as an architecture that has a dedicated error register.
+	* linux/sparc/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
+	define to 1.
+
+	strace.1.in: ffix.
+
+2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Include <sys/ptrace.h> early.
+	Include "ptrace.h" before any header that can include <signal.h>
+	because on some architectures the latter may include <asm/sigcontext.h>
+	which in turn may include <asm/ptrace.h> with potentially devastating
+	effect on <sys/ptrace.h>.
+
+	* process.c: Include "ptrace.h" before "regs.h".
+	* rt_sigframe.c: Likewise.
+	* sigreturn.c: Include "ptrace.h" before "nsig.h".
+	* syscall.c: Likewise.
+	* wait.c: Include "ptrace.h" before <sys/wait.h>.
+	* strace.c: Include "ptrace.h" before <signal.h>.
+	* tests/ptrace.c: Likewise.
+	* tests/test_ucopy.c: Include <sys/ptrace.h> before <signal.h>.
+
+2018-02-11  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Include <limits.h> instead of <sys/param.h>
+	Do not include <sys/param.h> unnecessarily as it includes <signal.h>.
+
+	* pathtrace.c: Include <limits.h> instead of <sys/param.h>.
+	* strace.c: Likewise.
+	* syscall.c: Likewise.
+	* util.c: Likewise.
+	* tests/getcwd.c: Likewise.
+	* tests/group_req.c: Likewise.
+	* tests/inode_of_sockfd.c: Likewise.
+	* tests/ip_mreq.c: Likewise.
+	* tests/printpath-umovestr.c: Likewise.
+	* tests/qual_fault.c: Likewise.
+	* tests/test_printpath.c: Likewise.
+	* tests/umovestr3.c: Likewise.
+	* tests/net-y-unix.c: Do not include <sys/param.h>.
+	* tests/net-yy-unix.c: Likewise.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	basic_filters.c: introduce scno_by_name.
+	As it will be used elsewhere.
+
+	* basic_filters.c (scno_by_name): New function.
+	(qualify_syscall_name): Use it.
+	* defs.h (scno_by_name): New declaration.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	xstring.h: rephrase xappendstr description a bit.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	xlat.c: return NULL in sprintflags if there are no flags.
+	Otherwise the auxstr is rather ugly at times.
+
+	* xlat.c (sprintflags): Return NULL if no flags were printed.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Change type of injected rval to kernel_long_t.
+	* defs.h (struct inject_data): Change type of rval field to
+	kernel_ulong_t.
+	* filter_qualify.c (parse_inject_token): Use string_to_kulong instead of
+	string_to_uint for rval parsing.  Warn if retval is clipped in compat
+	personality.
+
+	Mark architectures that indicate syscall error in a dedicated register.
+	* linux/alpha/arch_defs_.h (HAVE_ARCH_DEDICATED_ERR_REG): New macro,
+	define to 1.
+	* linux/ia64/arch_defs_.h: Likewise.
+	* linux/mips/arch_defs_.h: Likewise.
+	* linux/powerpc/arch_defs_.h: Likewise.
+	* linux/powerpc64/arch_defs_.h: Likewise.
+	* linux/sparc64/arch_defs_.h: Likewise.
+	* linux/arch_defs_.h [!HAVE_ARCH_DEDICATED_ERR_REG]
+	(HAVE_ARCH_DEDICATED_ERR_REG): New macro, define to 0.
+	* linux/nios2/arch_defs_.h: New file.
+	* Makefile.am (EXTRA_DIST): Add it.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Make string_to_uint_ex more universal.
+	And add support for reading of various types.
+
+	* string_to_uint.c (string_to_uint_ex): Change to work with long long.
+	(string_to_uint): Move it...
+	* string_to_uint.h (string_to_uint): ...here.
+	(string_to_uint_upto): Accept long long as max_val, return long long.
+	(string_to_ulong, string_to_kulong, string_to_ulonglong): New functions,
+	for completeness.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add pure syscall flag.
+	* basic_filters.c (lookup_class) <syscall_class>: Add "%pure" for
+	TRACE_PURE.
+	* sysent.h (TRACE_PURE): New syscall flag.
+	* sysent_shorthand_defs.h (PU): New shorthand macro.
+	* linux/32/syscallent.h ([172], [173], [174], [175], [176], [177],
+	[178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
+	getegid, gettid syscalls.
+	* linux/64/syscallent.h ([172], [173], [174], [175], [176], [177],
+	[178]): Add PU flag to getpid, getppid, getuid, geteuid, getgid,
+	getegid, gettid syscalls.
+	* linux/aarch64/syscallent.h ([1060]): Add PU flag to getpgrp syscalls.
+	* linux/alpha/syscallent.h ([20], [24], [47], [63], [64], [89],
+	[378]): Add PU flag to getxpid, getxuid, getxgid, getpgrp, getpagesize,
+	getdtablesize, gettid syscalls.
+	* linux/arc/syscallent.h ([246]): Add PU flag to arc_gettls syscalls.
+	* linux/arm/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [224], [ARM_FIRST_SHUFFLED_SYSCALL+1+6]):
+	Add PU flag to getpid, getuid, getgid, geteuid, getegid, getppid,
+	getpgrp, getuid32, getgid32, geteuid32, getegid32, gettid, get_tls
+	syscalls.
+	* linux/avr32/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[176]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/bfin/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
+	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/hppa/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[206]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/i386/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
+	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/ia64/syscallent.h ([1041], [1042], [1046], [1047], [1062],
+	[1063], [1105], [1171]): Add PU flag to getpid, getppid, getuid,
+	geteuid, getgid, getegid, gettid, getpagesize syscalls.
+	* linux/m68k/syscallent.h ([20], [24], [47], [49], [50], [64],
+	[65], [166], [199], [200], [201], [202], [221], [333]): Add PU flag
+	to getpid, getuid, getgid, geteuid, getegid, getppid, getpgrp,
+	getpagesize, getuid32, getgid32, geteuid32, getegid32, gettid,
+	get_thread_area syscalls.
+	* linux/metag/syscallent.h ([248]): Add PU flag to metag_get_tls
+	syscalls.
+	* linux/microblaze/syscallent.h ([20], [24], [47], [49], [50], [64],
+	[65], [199], [200], [201], [202], [224]): Add PU flag to getpid,
+	getuid, getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/powerpc64/syscallent.h ([20], [24], [47], [49], [50], [64],
+	[65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/powerpc/syscallent.h ([20], [24], [47], [49], [50], [64],
+	[65], [207]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/s390/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [236]): Add PU flag to getpid, getuid,
+	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/s390x/syscallent.h ([20], [64], [65], [199], [200], [201],
+	[202], [236]): Add PU flag to getpid, getppid, getpgrp, getuid,
+	getgid, geteuid, getegid, gettid syscalls.
+	* linux/sh64/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [252]): Add PU flag to getpid, getuid,
+	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/sh/syscallent.h ([20], [24], [47], [49], [50], [64], [65],
+	[199], [200], [201], [202], [224]): Add PU flag to getpid, getuid,
+	getgid, geteuid, getegid, getppid, getpgrp, getuid32, getgid32,
+	geteuid32, getegid32, gettid syscalls.
+	* linux/sparc64/syscallent.h ([20], [24], [47], [49], [50], [64], [81],
+	[143], [197], [340]): Add PU flag to getpid, getuid, getgid, geteuid,
+	getegid, getpagesize, getpgrp, gettid, getppid, kern_features syscalls.
+	* linux/sparc/syscallent.h ([20], [24], [44], [47], [49], [50], [53],
+	[64], [69], [70], [81], [143], [197], [340]): Add PU flag to getpid,
+	getuid, getuid32, getgid, geteuid, getegid, getgid32, getpagesize,
+	geteuid32, getegid32, getpgrp, gettid, getppid, kern_features syscalls.
+	* linux/x32/syscallent.h ([39], [102], [104], [107], [108], [110],
+	[111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/x86_64/syscallent.h ([39], [102], [104], [107], [108], [110],
+	[111], [186]): Add PU flag to getpid, getuid, getgid, geteuid, getegid,
+	getppid, getpgrp, gettid syscalls.
+	* linux/xtensa/syscallent.h ([120], [127], [137], [139], [140], [141],
+	[150], [151]): Add PU flag to getpid, gettid, getuid, getgid, geteuid,
+	getegid, getppid, getpgrp syscalls.
+	* strace.1.in (.SS Filtering): Document it.
+	* NEWS: Mention it.
+
+	syscall.c: warn if tampering failed.
+
+	syscall.c: set errno if syscall is tampered.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests/nsyscall-d.test: swap exp and log in diff calls.
+	In line with the rest of the tests.
+
+	* tests/nsyscalls-d.test: swap arguments of match_diff calls.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	linux/arm/get_scno.c: use debug_msg.
+	* linux/arm/get_scno.c (arch_get_scno): replace if (debug_flag) {
+	error_msg() } with debug_msg() call.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Do not shuffle scno inside syscall_name.
+	This makes interface a bit irregular otherwise.
+
+	* defs.h (syscall_name): Clarify description.
+	* syscall.c (syscall_name): Do not call shuffle_scno.
+	* printsiginfo.c (print_si_info) <case SIGSYS>: Use shuffle_scno.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Handle very special __ARM_NR_-prefixed syscalls.
+	* linux/aarch64/nr_prefix.c: New file.
+	* linux/arm/nr_prefix.c: Likewise.
+	* linux/nr_prefix.c: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* printsiginfo.c: Include nr_prefix.c
+	(print_si_info): Use nr_prefix.
+
+	Make shuffle_scno globally available.
+	* syscall.c (shuffle_scno): Move the declaration...
+	* defs.h (shuffle_scno): ...here. Remove static qualifier.
+	* linux/aarch64/shuffle_scno.c (shuffle_scno): Remove static qualifier.
+	* linux/arm/shuffle_scno.c: Likewise.
+	* linux/shuffle_scno.c: Likewise.
+	* linux/x32/shuffle_scno.c: Likewise.
+	* linux/x86_64/shuffle_scno.c: Likewise.
+
+2018-02-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: use shuffle_scno in syscall_name.
+	syscall_name() is used only in printsiginfo.c:print_si_info currently,
+	and is supplied with raw syscall number (that's why it has this ugly
+	__X32_SYSCALL_BIT hack). But since it handled only __X32_SYSCALL_BIT and
+	not shuffle_scno(), it was broken on ARM.  Let's replace it with shuffle_scno
+	call, as it handles both the case of shuffled ARM syscalls and the
+	__X32_SYSCALL_BIT.
+
+	* syscall.c (syscall_name): Call shuffle_scno instead of custom
+	__X32_SYSCALL_BIT handling.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Use shuffle_scno for x32 syscall numbers.
+	This changes behaviour of printing of unknown syscall.
+
+	* linux/x32/shuffle_scno.c: New file.
+	* linux/x86_64/shuffle_scno.c: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* linux/x86_64/get_scno.c (arch_get_scno): Do not clear
+	__X32_SYSCALL_BIT.
+	* tests/nsyscalls.c: Update expected output.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Move shuffle_scno() invocation to get_scno.
+	* linux/aarch64/get_scno.c (arch_get_scno): Remove shuffle_scno call.
+	* linux/arm/get_scno.c (arch_get_scno): Remove shuffle_scno calls.
+	* syscall.c (get_scno): Call shuffle_scno after arch_get_scno.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Move shuffle_scno to arch-specific file.
+	While we are here, let's fix AArch64 by limiting scno shuffling
+	to compat personality only.
+
+	* syscall.c: Include shuffle_scno.c.
+	(shuffle_scno): Move it to a...
+	* linux/arm/shuffle_scno.c: New file.
+	* linux/aarch64/shuffle_scno.c: New file, define arm's shuffle_scno
+	as arm_shuffle_scno and call it only for personality 1.
+	* linux/shuffle_scno.c: New file, fallback trivial shuffle_scno
+	definition.
+	* Makefile.am (EXTRA_DIST): Add them.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Print unknown syscall number in hexadecimal.
+	* syscall.c (struct sysent_buf): Update buf field size.
+	(get_scno): Print unknown syscall number in hexadecimal form.
+	* tests/nsyscalls.c: Update expected output.
+	* strace.1.in: Document it.
+	* NEWS: Mention it.
+
+	tests/accept.c: call accept syscall directly, if available.
+	* tests/accept.c [__NR_accept && !TEST_SYSCALL_NAME]: Define a wrapper that
+	calls accept directly.
+	* tests/sockname.c [TEST_SYSCALL_STR]: Do not define TEST_SYSCALL_STR.
+
+	printsiginfo.c: add a comment about personality detection for SIGSYS.
+	Looks like it is not necessary, after all.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	linux/x86_64/set_error.c: update eax for compat personality.
+	Since this is where get_error gets the return value from in the compat case.
+
+	linux/x86_64/set_error.c (set_error, set_success): Update i386_regs.eax
+	if tracee is in compat personality.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Mark various arch-specific syscalls with SYSCALL_NEVER_FAILS.
+	* linux/alpha/syscallent.h (getpagesize, getdtablesize): Add NF flag.
+	* linux/arc/syscallent.h (arc_gettls): Likewise.
+	* linux/arm/syscallent.h (get_tls): Likewise.
+	* linux/ia64/syscallent.h (getpagesize): Likewise.
+	* linux/m68k/syscallent.h (getpagesize, get_thread_area): Likewise.
+	* linux/sparc/syscallent.h (getpagesize): Likewise.
+	* linux/sparc64/syscallent.h (getpagesize): Likewise.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add SYSCALL_NEVER_FAILS flag to getpgrp.
+	As glibc, at least, treats it this way.
+
+	* linux/aarch64/syscallent.h (getpgrp): Add NF flag.
+	* linux/alpha/syscallent.h: Likewise.
+	* linux/arm/syscallent.h: Likewise.
+	* linux/avr32/syscallent.h: Likewise.
+	* linux/bfin/syscallent.h: Likewise.
+	* linux/hppa/syscallent.h: Likewise.
+	* linux/i386/syscallent.h: Likewise.
+	* linux/m68k/syscallent.h: Likewise.
+	* linux/microblaze/syscallent.h: Likewise.
+	* linux/powerpc/syscallent.h: Likewise.
+	* linux/powerpc64/syscallent.h: Likewise.
+	* linux/s390/syscallent.h: Likewise.
+	* linux/s390x/syscallent.h: Likewise.
+	* linux/sh/syscallent.h: Likewise.
+	* linux/sh64/syscallent.h: Likewise.
+	* linux/sparc/syscallent.h: Likewise.
+	* linux/sparc64/syscallent.h: Likewise.
+	* linux/x32/syscallent.h: Likewise.
+	* linux/x86_64/syscallent.h: Likewise.
+	* linux/xtensa/syscallent.h: Likewise.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	linux/x86_64/get_error.c: do not sign-extend if no error happened.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests/membarrier.c: fix expected output on nohz_full systems.
+	If nohz_full is enabled, MEMBARRIER_CMD_GLOBAL is not available.
+
+	* tests/membarrier.c: check availability of MEMBARRIER_CMD_GLOBAL
+	separately.
+
+2018-02-09  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update MEMBARRIER_CMD_* constants.
+	* xlat/membarrier_cmds.in: Add new constants, rename
+	MEMBARRIER_CMD_SHARED to MEMBARRIER_CMD_GLOBAL.
+	* NEWS: Mention this.
+	* tests/membarrier.c (main): Update expected output.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-02-07  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	perf.c: print group_fd argument of perf_event_open syscall as fd.
+	* perf.c (SYS_FUNC(perf_event_open)): Print 4th argument using printfd.
+
+	syscall.c: print higher bits of syscall return value on x32 personality.
+	* syscall.c (syscall_exiting_trace): Check for current_klongsize instead
+	of current_wordsize to determine the size of tcp->u_rval.
+
+	strace.1.in: history update.
+	strace.1.in (.SH HISTORY): Some amendments based on
+	https://github.com/strace/strace-talks/blob/master/2012-ossdevconf-obninsk-strace_from_upstream_PoV/ossdevconf_2012-slides-strace_from_upstream_PoV.tex
+
+	strace.1.in: minor changes.
+	* strace.1.in (.SH DESCRIPTION): s/a passion/passion/,
+	s/Here the/Here, the/, s/Where traditional/Where the traditional/,
+	s/output has proven/output is proven/, s/In all cases/In most cases,/¸
+	embolden st_mode, lstat, SIGCHLD, and SIGTTOU mentions,
+	s/In some cases /In some cases, /
+	(.SS Output format) <-o>: de-italicize dot in "filename.pid", convert
+	the sentence's voice to passive, some other rephrasing.  Mention
+	incompatibility of output piping with -ff mode.
+	(.SS Output options) <-t>: s/time of day/wall clock time/.
+	(.SS Statistics) <-c>: Remove "on Linux" mention, -F option mention.
+
+	README.md: add information about git repository location.
+	* README.md: Mention URLs for SourceForge, GitHub, and GitLab
+	repositories.
+
+2018-02-07  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: rewrite net-accept-connect.c without strncpy.
+	gcc8 -Wall -Werror rejects our method of struct sockaddr_un.sun_path
+	initialization because the field lacks __nonstring__ attribute.
+
+	As we calculate the length of the string being copied anyway,
+	workaround this gcc+glibc bug by changing the code to use this
+	pre-calculated length and get rid of strncpy completely.
+
+	* tests/net-accept-connect.c (main): Use memcpy to initialize sun_path.
+
+2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Use kernel's fcntl.h header instead of libc's for open_mode_flags.
+	As definitions of O_* macros provided by various libc implementations
+	are usually less reliable than those provided by kernel headers, switch
+	to use kernel's fcntl.h header.
+
+	* open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
+	O_LARGEFILE fallback definitions assuming that the kernel headers
+	provide them.
+	* xlat/open_mode_flags.in: Add __O_SYNC after O_SYNC.  Add O_TMPFILE
+	and __O_TMPFILE before O_DIRECTORY.  Remove "O_TMPFILE & ~O_DIRECTORY".
+	* tests/open.c: Include <asm/fcntl.h> instead of <fcntl.h>.  Remove
+	workarounds for libc O_TMPFILE implementations.
+	* tests/openat.c: Include <asm/fcntl.h> instead of <fcntl.h>.
+	(test_mode_flag): New function.
+	(main): Use it to check decoding of all access modes and file flags.
+	* tests/gen_tests.in (openat): Add -a option.
+
+	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
+
+2018-02-06  Dmitry V. Levin  <ldv@altlinux.org>
+
+	xlat: update TCP_* constants.
+	* xlat/socktcpoptions.in: Add TCP_FASTOPEN_KEY and
+	TCP_FASTOPEN_NO_COOKIE introduced by linux kernel commits
+	v4.15-rc1~84^2~387 and v4.15-rc1~84^2~339, respectively.
+	* NEWS: Mention this.
+
+	xlat: update IPV6_* constants.
+	* xlat/sockipv6options.in: Add IPV6_FREEBIND introduced by linux kernel
+	commit v4.15-rc1~84^2~601.
+	* NEWS: Mention this.
+
+	xlat: update MAP_* constants.
+	* xlat/mmap_flags.in: Add MAP_SHARED_VALIDATE and MAP_SYNC introduced
+	by linux kernel commits v4.15-rc1~71^2^2~23 and v4.15-rc1~71^2^2~12,
+	respectively.
+	* NEWS: Mention this.
+
+2018-02-06  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: avoid triggering -Wstringop-truncation in ioctl_dm.c.
+	* tests/ioctl_dm.c: Replace strncpy calls with memcpy as the character
+	arrays being copied are not C strings.
+
+	Makefile.am: minor EXTRA_DIST formatting changes.
+
+	Move large file-related wrappers to a separate header.
+	* strace.c [_LARGEFILE64_SOURCE]: Move the definitions under it to a...
+	* largefile_wrappers.h: ... new file.
+	* Makefile.am (strace_SOURCES): Add it.
+
+2018-01-29  Dmitry V. Levin  <ldv@altlinux.org>
+
+	strace.1: fix wording about setuid installation.
+	* strace.1.in (SETUID INSTALLATION): Fix wording.
+
+	Closes: https://github.com/strace/strace/issues/24
+
+2018-01-29  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>
+
+	Add KVM_PPC_GET_CPU_CHAR ioctl definition from linux v4.15.
+	* linux/powerpc/ioctls_arch0.h: Update from linux v4.15
+	using ioctls_gen.sh.
+
+2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update NEWS.
+
+	tests: check s390_pci_mmio_read and s390_pci_mmio_write decoders.
+	* tests/s390_pci_mmio_read_write.c: New file.
+	* tests/.gitignore: Add s390_pci_mmio_read_write.
+	* tests/pure_executables.list: Likewise.
+	* tests/gen_tests.in (s390_pci_mmio_read_write): New test.
+
+	Introduce s390_pci_mmio_read, s390_pci_mmio_write system call decoders.
+	* linux/s390/syscallent.h ([352]): Change decoder to s390_pci_mmio_write.
+	([353]): Change decoder to s390_pci_mmio_read.
+	* linux/s390x/syscallent.h: Likewise.
+	* s390.c (SYS_FUNC(s390_pci_mmio_write), SYS_FUNC(s390_pci_mmio_read)):
+	New function.
+
+	tests: check s390_runtime_instr system call decoder.
+	* tests/s390_runtime_instr.c: New file.
+	* tests/.gitignore: Add s390_runtime_instr.
+	* tests/pure_executables.list: Likewise.
+	* tests/gen_tests.in (s390_runtime_instr): New test.
+
+	Introduce s390_runtime_instr system call decoder.
+	* linux/s390/syscallent.h ([342]): Change decoder to s390_runtime_instr.
+	* linux/s390x/syscallent.h: Likewise.
+	* s390.c (SYS_FUNC(s390_runtime_instr)): New function.
+	* xlat/s390_runtime_instr_commands.in: New file.
+
+	tests: check s390_guarded_storage system call decoder.
+	* configure.ac (AC_CHECK_HEADERS): Add asm/guarded_storage.h.
+	* tests/s390_guarded_storage-v.c: New file.
+	* tests/s390_guarded_storage.c: Likewise.
+	* tests/.gitignore: Add s390_guarded_storage, s390_guarded_storage-v.
+	* tests/pure_executables.list: Likewise.
+	* tests/gen_tests.in (s390_guarded_storage, s390_guarded_storage-v):
+	New tests.
+
+	Introduce s390_guarded_storage system call decoder.
+	* linux/s390/syscallent.h ([378]): Change decoder to s390_guarded_storage.
+	* linux/s390x/syscallent.h: Likewise.
+	* s390.c (struct guard_storage_control_block,
+	struct guard_storage_event_parameter_list): New structure type
+	definition.
+	(guard_storage_print_gsepl, guard_storage_print_gscb,
+	SYS_FUNC(s390_guarded_storage)): New function.
+	(DIV_ROUND_UP): New macro.
+	* xlat/s390_guarded_storage_commands.in: New file.
+
+	tests: check s390_sthyi system call decoder.
+	* configure.ac (AC_CHECK_FUNCS): Add iconv_open.
+	(AC_CHECK_HEADERS): Add iconv.h.
+	* tests/s390_sthyi-v.c: New file.
+	* tests/s390_sthyi.c: Likewise.
+	* tests/.gitignore: Add s390_sthyi, s390_sthyi-v.
+	* tests/pure_executables.list: Likewise.
+	* tests/gen_tests.in (s390_sthyi, s390_sthyi): New tests.
+
+	Introduce s390_sthyi system call decoder.
+	* s390.c: New file.
+	* Makefile.am (strace_SOURCES): Add it.
+	* linux/s390/syscallent.h ([380]): Change decoder to s390_sthyi.
+	* linux/s390x/syscallent.h: Likewise.
+	* xlat/s390_sthyi_function_codes.in: New file.
+
+	print_fields.h: add macro to print hexadecimal array field.
+	* print_fields.h (PRINT_FIELD_HEX_ARRAY): New macro, prints target
+	array with QUOTE_FORCE_HEX.
+
+2018-01-29  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add print_quoted_string flag to generate comment.
+	Because there are never enough print_quoted_string flags.
+
+	* defs.h (QUOTE_EMIT_COMMENT): New quoting flag macro constant.
+	* util.c (string_quote): Emit " /* " in the beginning and " */" in the
+	end if QUOTE_EMIT_COMMENT is passed.
+	(print_quoted_string): Increase alloc_size by 7 if QUOTE_EMIT_COMMENT is
+	passed.
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: make ioctl.test more flexible, use it for the rest of ioctl tests
+	As the remaining non-generated ioctl tests differ from ioctl.test only
+	in strace options, and since gen_tests.sh can pass arguments to sourced
+	tests, replace the remaining non-generated ioctl tests with invocations
+	of ioctl.test with appropriate parameters.
+
+	* tests/ioctl.test: Pass script arguments to the strace invocation.
+	* tests/gen_tests.in (ioctl_dm): New entry, invoke ioctl.test with -s9.
+	(ioctl_dm-v): New entry, invoke ioctl.test with -v -s9.
+	(ioctl_kvm_run): New entry, invoke ioctl.test with -a36 -y.
+	(ioctl_loop-nv): New entry, invoke ioctl.test with -a22 -e verbose=none.
+	(ioctl_nsfs): New entry, invoke ioctl.test with -esignal=none.
+	(ioctl_sock_gifconf): New entry, invoke ioctl.test with -a28 -s1.
+	(ioctl_evdev-v, ioctl_loop-v, ioctl_rtc-v): Invoke ioctl.test
+	with -v option instead of ioctl-v.sh.
+	* tests/ioctl_dm-v.test: Remove.
+	* tests/ioctl_dm.test: Likewise.
+	* tests/ioctl_kvm_run.test: Likewise.
+	* tests/ioctl_loop-nv.test: Likewise.
+	* tests/ioctl_nsfs.test: Likewise.
+	* tests/ioctl_sock_gifconf.test: Likewise.
+	* tests/ioctl-v.sh: Likewise.
+	* tests/Makefile.am (DECODER_TESTS, EXTRA_DIST): Remove them.
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests/gen_tests.sh: enable passing arguments to sourced tests.
+	* tests/gen_tests.sh: Read first argument separately, put it in $arg0,
+	and the rest of the arguments in $args.
+	(case "$arg0" in) <+*)>: Set command line to $args and source $arg0.
+
+	xlat/gen.sh: add some rudimentary support for comments.
+	* xlat/gen.sh: Trim parts of the string abbreviated in "/*" and "*/"
+
+	configure.ac: sort architectures in lexicographical order.
+	* configure.ac (case "$host_cpu"): sort architectures in alphabetical
+	order.
+
+2018-01-25  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Drop non-functional CRIS architecture support.
+	From the very first commit when CRIS architecture support was introduced
+	and up to this comment that ends the agony of this non-functional code,
+	this support was incomplete and could never be compiled.
+
+	* Makefile.am (EXTRA_DIST): Remove linux/crisv*.
+	* clone.c: Remove CRISV* checks.
+	* configure.ac ($host_cpu == cris*): Remove.
+	* linux/crisv10: Remove.
+	* linux/crisv32: Likewise.
+
+	Fixes: v4.5.18-77-gea0e6e8 ("CRIS support by Hinko Kocevar ...")
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update futex test in accordance with kernel's v4.15-rc7-202-gfbe0e83.
+	* futex.c (VALP, VALP_PR, VAL2P, VAL2P_PR): New macro definitions.
+	(main): Allow EINVAL on *REQUEUE* checks with VAL/VAL2 with higher bit
+	being set, check that the existing behaviour preserved with VALP/VAL2P
+	where higher bit is unset.
+
+	tests/futex.c: improve error diagnostics.
+	* tests/futex.c (futex_error): Add func and line arguments, print them.
+	(CHECK_FUTEX_GENERIC): Pass __func__ and __LINE__ to futex_error.
+
+	Add syscall entry for ARM-specific get_tls syscall.
+	* linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+6]): New entry.
+	(ARM_LAST_SPECIAL_SYSCALL): Update to 6.
+	* NEWS: Mention it.
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Fix syscall descriptions for ARM-specific system calls.
+	Based on an analysis of arm_syscall in arch/arm/kernel/traps.c.
+
+	* linux/arm/syscallent.h ([ARM_FIRST_SHUFFLED_SYSCALL+1+2]): Update
+	argument number, add TM flag.
+	([ARM_FIRST_SHUFFLED_SYSCALL+1+1], [ARM_FIRST_SHUFFLED_SYSCALL+1+3],
+	[ARM_FIRST_SHUFFLED_SYSCALL+1+4], [ARM_FIRST_SHUFFLED_SYSCALL+1+5]):
+	Update argument number.
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check riscv_flush_icache syscall decoder.
+	* tests/riscv_flush_icache.c: New file.
+	* tests/.gitignore: Add riscv_flush_icache.
+	* tests/gen_tests.in: Likewise.
+	* tests/pure_executables.list: Likewise.
+
+	Implement decoding of riscv_flush_icache syscall.
+	* linux/riscv/syscallent.h ([259]): Add riscv_flush_icache entry.
+	* riscv.c: New file.
+	* Makefile.am (strace_SOURCES): Add it.
+	* xlat/riscv_flush_icache_flags.in: New file.
+	* NEWS: Mention it.
+
+2018-01-25  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Workaround stray PTRACE_EVENT_EXEC.
+	We (apparently) had a long-standing test failure inside strace-ff.test
+	with the symptom that it misses exit_group call.  As it turned out, it
+	was PTRACE_EVENT_EXEC followed by execve syscall exiting stop.  That
+	behaviour indeed screwed all the syscall state tracking for the tracee.
+	Let's try to patch it up by calling trace_syscall when we receive
+	PTRACE_EVENT_EXEC outside syscall.
+
+	* defs.h (TCB_RECOVERING): New tcb flag.
+	* strace.c (dispatch_event) <case TE_STOP_BEFORE_EXECVE>: Invoke
+	trace_syscall with TCB_RECOVERING flag being set for the current_tcp
+	if the tracee is not on exiting syscall.
+	* syscall.c (get_scno): Set QUAL_RAW if we are recovering.
+	(tamper_with_syscall_entering): Do not perform actual tampering during
+	recovery as it's already too late.
+	* NEWS: Mention it.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: robustify set_ptracer_any.
+	* tests/set_ptracer_any.c (main) [HAVE_PRCTL]: Provide fallback
+	definitions for PR_SET_PTRACER and PR_SET_PTRACER_ANY constants,
+	set all unused prctl arguments to 0.
+
+2018-01-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	ia64: do not bail out in get_syscall_args if umove fails with EPERM.
+	If the kernel contains commit 84d77d3f06e7e8dea057d10e8ec77ad71f721be3,
+	both PTRACE_PEEKDATA and process_vm_readv become unavailable when the
+	process dumpable flag is cleared, on ia64 this results to all syscall
+	arguments being unavailable.
+
+	Recognize this situation and do not treat it as get_syscall_args error
+	because the latter leaves the tracee in a ptrace stop.
+
+	This condition used to be triggered by prctl-dumpable test that caused
+	strace to hang indefinitely.
+
+	* linux/ia64/get_syscall_args.c (get_syscall_args): Do not bail out
+	if umove fails.
+	* tests/prctl-dumpable.c [__ia64__]: Skip the test.
+
+2018-01-24  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.c: reset printing_tcp on print_event_exit.
+	print_event_exit should have printing_tcp setup analogous to printleader and
+	syscall_exit_trace before printing its part, otherwise it spuriously resets
+	curcol in line_ended for the stale printing_tcp if followfork == 2.
+
+	* strace.c (print_event_exit): Set printing_tcp to tcp before printing
+	exiting event line and calling line_ended.
+
+2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: check path tracing of old select syscall.
+	* tests/xselect.c [xselect] (xselect): Turn into prototype.
+	* tests/oldselect-P.c: New file.
+	* tests/oldselect-efault-P.c: Likewise.
+	* tests/oldselect-efault.c: Likewise.
+	* tests/oldselect.c: Use xselect.c
+	* tests/pure_executables.list: Add oldselect-efault.
+	* tests/gen_tests.in (oldselect, oldselect-P, oldselect-efault,
+	oldselect-efault-P): New entries.
+	* tests/oldselect.expected: Remove.
+	* tests/oldselect.test: Remove.
+	* tests/Makefile.am (check_PROGRAMS): Add oldselect-P
+	and oldselect-efault-P.
+	(DECODER_TESTS): Remove oldselect.test.
+	(EXTRA_DIST): Remove oldselect.expected.
+	* tests/.gitignore: Add oldselect-P, oldselect-efault,
+	and oldselect-efault-P.
+
+	tests: check path tracing of select/_newselect syscalls.
+	* tests/xselect.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
+	is not available.  Add test calls that use PATH_TRACING_FD.
+	(main): Conditionalize expected output for those calls
+	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
+	* tests/_newselect-P.c: New file.
+	* tests/select-P.c: Likewise.
+	* tests/Makefile.am (check_PROGRAMS): Add _newselect-P and select-P.
+	* tests/.gitignore: Likewise.
+	* tests/gen_tests.in (_newselect-P, select-P): New entries.
+
+	tests: extend the check of select/_newselect syscalls decoding.
+	* tests/xselect.c: Rewrite for better coverage.
+
+2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: redirect stdin to /dev/null.
+	Ensure that stdin descriptor is not available for output
+	by reopening it to input from /dev/null.
+
+	* tests/run.sh: Redirect test's stdin to /dev/null.
+
+2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: add file:line to perror_msg_and_fail/error_msg_and_fail output.
+	* tests/tests.h [!perror_msg_and_fail] (perror_msg_and_fail): New macro
+	wrapper around the homonymous function.
+	[!error_msg_and_fail] (error_msg_and_fail): Likewise.
+	* tests/error_msg.c (perror_msg_and_fail, error_msg_and_fail): New
+	macros defined to themselves.
+
+	Rework decoding and pathtrace of old select syscall.
+	* linux/arch_defs_.h [!HAVE_ARCH_OLD_SELECT] (HAVE_ARCH_OLD_SELECT): New
+	macro.
+	* linux/aarch64/arch_defs_.h (HAVE_ARCH_OLD_SELECT): Likewise.
+	* linux/arm/arch_defs_.h: Likewise.
+	* linux/bfin/arch_defs_.h: Likewise.
+	* linux/i386/arch_defs_.h: Likewise.
+	* linux/m68k/arch_defs_.h: Likewise.
+	* linux/microblaze/arch_defs_.h: Likewise.
+	* linux/powerpc64/arch_defs_.h: Likewise.
+	* linux/sh/arch_defs_.h: Likewise.
+	* linux/x32/arch_defs_.h: Likewise.
+	* linux/x86_64/arch_defs_.h: Likewise.
+	* linux/powerpc/arch_defs_.h: New file.
+	* Makefile.am (EXTRA_DIST): Add it.
+	* desc.c (SYS_FUNC(oldselect)): Rewrite using
+	fetch_indirect_syscall_args, move under [HAVE_ARCH_OLD_SELECT].
+	* pathtrace.c (match_xselect_args): New function.
+	(pathtrace_match_set): Use it.
+
+2018-01-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Transform fetch_old_mmap_args into fetch_indirect_syscall_args.
+	As there are more than one old style syscall that take their arguments
+	via array, generalize fetch_old_mmap_args into a function that could
+	fetch variable number of arguments.
+
+	* mem.c (fetch_old_mmap_args): Transform into ...
+	* fetch_indirect_syscall_args.c: ... fetch_indirect_syscall_args
+	in this new file.
+	* Makefile.am (libstrace_a_SOURCES): Add it.
+	* defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Remove.
+	(fetch_indirect_syscall_args): New prototype.
+	* pathtrace.c (pathtrace_match_set) [HAVE_ARCH_OLD_MMAP]: Use
+	fetch_indirect_syscall_args instead of fetch_old_mmap_args.
+
+2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	signal.c: remove excess semicolon after the end of the function.
+	* signal.c (rt_sigtimedwait): Remove semicolon after the function body.
+
+	Use char * for pointer arithmetics.
+	* netlink_inet_diag.c (decode_inet_diag_req_compat,
+	decode_inet_diag_req_v2, decode_inet_diag_msg): Cast to char *
+	instead of void *.
+	* netlink_netlink_diag.c (decode_netlink_diag_req,
+	decode_netlink_diag_msg): Likewise.
+	* netlink_packet_diag.c (decode_packet_diag_req,
+	decode_packet_diag_msg): Likewise.
+	* netlink_unix_diag.c (decode_unix_diag_req, decode_unix_diag_msg):
+	Likewise.
+	* rtnl_addr.c (decode_ifaddrmsg): Likewise.
+	* rtnl_addrlabel.c (decode_ifaddrlblmsg): Likewise.
+	* rtnl_dcb.c (decode_dcbmsg): Likewise.
+	* rtnl_link.c (decode_ifinfomsg): Likewise.
+	* rtnl_mdb.c (decode_br_port_msg): Likewise.
+	* rtnl_neigh.c (decode_ndmsg): Likewise.
+	* rtnl_route.c (decode_rtmsg): Likewise.
+	* rtnl_rule.c (decode_fib_rule_hdr): Likewise.
+	* rtnl_tc.c (decode_tcmsg): Likewise.
+
+2018-01-23  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	netlink_inet_diag.c: remove unnecessary return.
+	decode_inet_diag_req, as well as the functions it calls, returns void.
+
+	* netlink_inet_diag.c (decode_inet_diag_req): Do not return anything.
+
+2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Move decoder of getpagesize syscall to libstrace.
+	As only five architectures have getpagesize syscall, moving the decoder
+	to libstrace allows to get rid of getpagesize related ifdefs and check
+	build of getpagesize decoder on other architectures.
+
+	* mem.c (SYS_FUNC(getpagesize)): Move ...
+	* getpagesize.c: ... to this new file.
+	* Makefile.am (libstrace_a_SOURCES): Add it.
+
+2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	mpers: implement gawk 3 support.
+	Some old systems that still make some sense to be supported have only
+	gawk 3, so let's support them for now.
+
+	In order to achieve that, multiple changes have been implemented:
+	 - Multidimensional arrays are replaced with single-dimensional ones.
+	   In most places it's a "][" -> ", " replacement, as awk allows some
+	   kind of emulation of multidimensional arrays that way, but in several
+	   occasions (specifically for storing name and special fields) we have
+	   to iterate over them later, so we store that information in
+	   additional arrays in order to get the keys.
+	 - "switch" statements are replaced with sets of "if ... else if ...
+	   else" statements.  This change is trivial, except we've added
+	   a temporary variable in what_is order to store expression value, for
+	   readability purposes.
+	 - No support for array iteration ordering.  This one is most ugly of
+	   them all.  Luckily, not that ugly, we've just had to process index a
+	   bit in order to make it lexicographically sortable and add two
+	   temporary arrays containing sorted indices in order to sort over them
+	   instead of those two arrays that we've added in order to work around
+	   lack of multidimensional array support.
+
+	* mpers.awk (compare_indices): Remove unused function.
+	(array_get, update_upper_bound, /^DW_AT_data_member_location/,
+	/^DW_AT_byte_size/, /^DW_AT_encoding/): Replace multidimensional array
+	access with comma-concatenated index.
+	(norm_idx): New function.
+	(array_seq): Replace multidimensional array access with
+	comma-concatenated index.  Use comma-concatenated pair of (array_idx,
+	"seq") in order to check presence of the item in an array.
+	(what_is): Add enc and i local variables.  Store the value of
+	array[what_idx, "encoding"] in it.  Replace "switch" statements with
+	sets of "if ... else if ... else" statements.  Replace multidimensional
+	array access with comma-concatenated index. Use for (... ; ...; ...)
+	iteration over aparents_keys instead of iteration over array.
+	(/^<[[:xdigit:]]+>/): Store idx as norm_idx(matches[2]).  Replace
+	multidimensional array access with comma-concatenated index.  Store an
+	additional flag in array_names array.
+	(/^DW_AT_name/): Replace multidimensional array access with
+	comma-concatenated index.  Add a flag to array_names for that idx.
+	(/^DW_AT_type/): Do not capture "0x" as a part of a group, normalise
+	the captured group.  Replace multidimensional array access with
+	comma-concatenated index.
+	(/^Abbrev Number:[^(]+\(DW_TAG_/): Replace multidimensional array access
+	with comma-concatenated index.  Store additional flags in
+	array_special and array_parents arrays.
+	(END): Remove PROCINFO["sorted_in"] setup.  Sort array_parents.  Replace
+	multidimensional array access with comma-concatenated index.  Iterate
+	over array_special to go over all the items that have "special" field.
+	Iterate over array_names to go over all items that have "name" field.
+	* NEWS: Mention it.
+
+2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	dm: add support for event_nr in DM_LIST_DEVICES result.
+	Commit v4.13-rc1~137^2~13 (and a follow-up fix v4.14-rc4~20^2~3
+	that changed alignment) introduced an additional hidden field
+	in the structure returned by DM_LIST_DEVICES ioctl command
+	that contains event_nr information.
+
+	Unfortunately, we can't test it for now, but looks like it kinda works:
+
+	  # ./strace -v -eioctl -y dmsetup ls
+	  ioctl(3</dev/mapper/control>, DM_VERSION, {version=4.0.0,
+	  data_size=16384, flags=DM_EXISTS_FLAG} => {version=4.37.0,
+	  data_size=16384, flags=DM_EXISTS_FLAG}) = 0
+	  ioctl(3</dev/mapper/control>, DM_LIST_DEVICES, {version=4.0.0,
+	  data_size=16384, data_start=312, flags=DM_EXISTS_FLAG} =>
+	  {version=4.37.0, data_size=408, data_start=312, flags=DM_EXISTS_FLAG,
+	  {dev=makedev(253, 1), name="fedoratesting--30-swap", event_nr=0},
+	  {dev=makedev(253, 0), name="fedoratesting--30-root"}}) = 0
+	  fedoratesting--30-swap	(253:1)
+	  fedoratesting--30-root	(253:0)
+
+	* dm.c (dm_decode_dm_name_list): Obtain the amount of bytes copied
+	during printing device name, print event number if there's a suitable
+	gap present and the DM version is high enough.
+	* NEWS: Mention it.
+
+2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Move definition of personality macros to arch_defs_.h.
+	* supported_personalities.h: Remove.
+	* defs.h: Do not include it.
+	* linux/arch_defs_.h [!DEFAULT_PERSONALITY] (DEFAULT_PERSONALITY): New
+	macro.
+	[!SUPPORTED_PERSONALITIES] (SUPPORTED_PERSONALITIES): Likewise.
+	* linux/aarch64/arch_defs_.h (SUPPORTED_PERSONALITIES): New macro.
+	* linux/riscv/arch_defs_.h: Likewise.
+	* linux/s390x/arch_defs_.h: Likewise.
+	* linux/sparc64/arch_defs_.h: Likewise.
+	* linux/x32/arch_defs_.h: Likewise.
+	* linux/x86_64/arch_defs_.h: Likewise.
+	* linux/powerpc64/arch_defs_.h: New file.
+	* linux/tile/arch_defs_.h: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	(strace_SOURCES): Remove supported_personalities.h.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-21  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Introduce HAVE_ARCH_SA_RESTORER.
+	In order to simplify HAVE_SA_RESTORER logic a bit.
+
+	* linux/ia64/arch_defs_.h (HAVE_ARCH_SA_RESTORER): New macro.
+	* linux/m68k/arch_defs_.h: Likewise.
+	* linux/sparc/arch_defs_.h: Likewise.
+	* linux/sparc64/arch_defs_.h: Likewise.
+	* linux/hppa/arch_defs_.h: New file.
+	* Makefile.am (EXTRA_DIST): Add it.
+	* signal.c [HAVE_ARCH_SA_RESTORER]: Define HAVE_SA_RESTORER to it.
+	[!HAVE_ARCH_SA_RESTORER && SA_RESTORER]: Define HAVE_SA_RESTORER to 1.
+	[!HAVE_ARCH_SA_RESTORER && !SA_RESTORER]: Define HAVE_SA_RESTORER to 0.
+
+2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Replace NEED_UID16_PARSERS with HAVE_ARCH_UID16_SYSCALLS.
+	* linux/arch_defs_.h [!HAVE_ARCH_UID16_SYSCALLS]
+	(HAVE_ARCH_UID16_SYSCALLS): New macro.
+	* linux/aarch64/arch_defs_.h (HAVE_ARCH_UID16_SYSCALLS): New macro.
+	* linux/arm/arch_defs_.h: Likewise.
+	* linux/i386/arch_defs_.h: Likewise.
+	* linux/ia64/arch_defs_.h: Likewise.
+	* linux/m68k/arch_defs_.h: Likewise.
+	* linux/s390/arch_defs_.h: Likewise.
+	* linux/s390x/arch_defs_.h: Likewise.
+	* linux/sh/arch_defs_.h: Likewise.
+	* linux/sparc/arch_defs_.h: Likewise.
+	* linux/sparc64/arch_defs_.h: Likewise.
+	* linux/syscall.h: Likewise.
+	* linux/x32/arch_defs_.h: Likewise.
+	* linux/x86_64/arch_defs_.h: Likewise.
+	* linux/bfin/arch_defs_.h: New file.
+	* linux/microblaze/arch_defs_.h: Likewise.
+	* linux/riscv/arch_defs_.h: Likewise.
+	* linux/sh64/arch_defs_.h: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* defs.h (NEED_UID16_PARSERS): Remove.
+	* linux/syscall.h: Check for HAVE_ARCH_UID16_SYSCALLS instead of
+	NEED_UID16_PARSERS.
+	* uid.c: Likewise.
+
+	Replace HAVE_GETRVAL2 with HAVE_ARCH_GETRVAL2.
+	* linux/arch_defs_.h [!HAVE_ARCH_GETRVAL2] (HAVE_ARCH_GETRVAL2): New
+	macro.
+	* linux/alpha/arch_defs_.h: New file.
+	* linux/ia64/arch_defs_.h: Likewise.
+	* linux/mips/arch_defs_.h: Likewise.
+	* linux/sh/arch_defs_.h: Likewise.
+	* linux/sparc/arch_defs_.h: Likewise.
+	* linux/sparc64/arch_defs_.h: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* defs.h (HAVE_GETRVAL2): Remove.
+	(getrval2): Check for HAVE_ARCH_GETRVAL2 instead of arch checks.
+	* net.c (SYS_FUNC(pipe)): Check for HAVE_ARCH_GETRVAL2 instead of
+	HAVE_GETRVAL2.
+	* syscall.c: Likewise.
+
+	Use #if idiom instead of #ifdef for HAVE_ARCH_* macros.
+	* linux/arch_defs_.h [!HAVE_ARCH_OLD_MMAP] (HAVE_ARCH_OLD_MMAP): New
+	macro.
+	[!HAVE_ARCH_OLD_MMAP_PGOFF] (HAVE_ARCH_OLD_MMAP_PGOFF): Likewise.
+	* defs.h: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP.
+	* mem.c: Use #if instead of #ifdef to check HAVE_ARCH_OLD_MMAP
+	and HAVE_ARCH_OLD_MMAP_PGOFF
+	* pathtrace.c: Likewise.
+
+2018-01-21  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Rename arch-specific arch_defs.h files to arch_defs_.h.
+	Introduce a new arch_defs.h header that includes the corresponding
+	arch-specific arch_defs_.h file followed by generic arch_defs_.h file.
+
+	* linux/arch_defs.h: Rename to linux/arch_defs_.h.
+	* linux/aarch64/arch_defs.h: Rename to linux/aarch64/arch_defs_.h.
+	* linux/arm/arch_defs.h: Rename to linux/arm/arch_defs_.h.
+	* linux/i386/arch_defs.h: Rename to linux/i386/arch_defs_.h.
+	* linux/m68k/arch_defs.h: Rename to linux/m68k/arch_defs_.h.
+	* linux/s390/arch_defs.h: Rename to linux/s390/arch_defs_.h.
+	* linux/s390x/arch_defs.h: Rename to linux/s390x/arch_defs_.h.
+	* linux/x32/arch_defs.h: Rename to linux/x32/arch_defs_.h.
+	* linux/x86_64/arch_defs.h: Rename to linux/x86_64/arch_defs_.h.
+	* arch_defs.h: New file.
+	* Makefile.am (strace_SOURCES): Add it.
+	(EXTRA_DIST): Rename linux/*/arch_defs.h to linux/*/arch_defs_.h.
+
+2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Fix ANY_WORDSIZE_LESS_THAN_KERNEL_LONG definition.
+	* defs.h (ANY_WORDSIZE_LESS_THAN_KERNEL_LONG): Rewrite without undefined
+	behaviour.
+
+	Fixes: f916793 ("Introduce ANY_WORDSIZE_LESS_THAN_KERNEL_LONG macro")
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	util: return string size in printstr.
+	As umovestr now returns something useful, let's propagate it further.
+
+	* defs.h (printstr_ex, printpathn, printpath): Change return type from
+	void to int.
+	(printstrn, printstr): Change return type from void to int, return
+	printstr_ex result.
+	* util.c (printpathn): Return -1 on NULL addr, nul_seen (exit code of
+	umovestr) on success.
+	(printpath): Return printpathn result.
+	(printstr_ex): Return -1 on NULL addr, umoven/umovestr result otherwise.
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	ucopy: return string size in umovestr.
+	We return the size that includes \0 in order to preserve existing
+	behaviour (return 0 when \0 haven't been seen, return positive number
+	when it has been seen).
+
+	* ucopy.c (umovestr_peekdata, umovestr): Return string length
+	including \0 instead of 1 when \0 is found.
+
+2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>
+
+	mpers.awk: avoid redefinition of mpers_ptr_t.
+	Older versions of gcc like those found in RHEL6 fail with the following
+	diagnostics:
+
+	  In file included from block.c:32:
+	  ./mpers-m32/struct_blk_user_trace_setup.h:2: error: redefinition of typedef ‘mpers_ptr_t’
+	  mpers_type.h:44: note: previous declaration of ‘mpers_ptr_t’ was here
+
+	* mpers.awk (END): Add #ifndef guard to mpers_ptr_t typedef.
+	* mpers_test.sh: Update expected output.
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add support for --enable-mpers=m32|mx32.
+	* configure.ac (AC_ARG_ENABLE([mpers])): Allow m32 and mx32 values
+	for --enable-mpers option.
+	* m4/mpers.m4 (st_MPERS): Check for personality support if personality
+	name is provided as an option.  Fail if the requested personality
+	support is not available.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: improve setugid error diagnostics a bit.
+	* tests/setugid.c (main): Print unexpected code returned by syscall.
+
+2018-01-19  Dmitry V. Levin  <ldv@altlinux.org>
+
+	v4l2: do not mpersify struct v4l2_create unless it is used by other code
+	This fixes build with mpers support on older systems that lack
+	definition of struct v4l2_create.
+
+	* v4l2.c: Wrap references to struct v4l2_create with
+	[VIDIOC_CREATE_BUFS].
+
+2018-01-18  Dmitry V. Levin  <ldv@altlinux.org>
+
+	btrfs: use uint32_t instead of __u32.
+	* btrfs.c (btrfs_ioctl) [!HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE]:
+	Replace __u32 with uint32_t.  Remove useless cast.
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.1.in: clarify mpers flags in strace -V output.
+	The previous description was a bit dated.
+
+	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Remove "no-m32" and
+	"no-mx32", describe the situation when some of mpers flags are not
+	present in strace -V output.
+
+2018-01-19  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add compat support for s390x.
+	By very popular demand.
+
+	While we are here, let's refactor the condition for old_mmap_pgoff into
+	an arch-specific one, as it is used more than in one place.
+
+	* NEWS: Mention this.
+	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): Likewise.
+	* configure.ac (case "$host_cpu" in) <s390x>: Set arch_m32 to s390, set
+	cc_flags_m32 to -m31.
+	(st_MPERS([m32])): Add s390x.
+	* defs.h [S390X]: Define NEED_UID16_PARSERS.
+	* linux/s390/arch_sigreturn.c [!S390_FRAME_PTR] (S390_FRAME_PTR): New
+	macro, define to s390_frame_ptr.
+	[!SIGNAL_FRAMESIZE] (SIGNAL_FRAMESIZE): New macro, define to
+	__SIGNAL_FRAMESIZE.
+	[!PTR_TYPE] (PTR_TYPE): New macro, define to unsigned long.
+	(arch_sigreturn): Use S390_FRAME_PTR, SIGNAL_FRAMESIZE, and PTR_TYPE
+	instead of s390_frame_ptr, __SIGNAL_FRAMESIZE, and pointer-sized type,
+	respectively.
+	* linux/s390/get_error.c [!ARCH_REGSET] (ARCH_REGSET): New macro, define
+	* to s390_regset.
+	(get_error): Use it instead of s390_regset.
+	* linux/s390/get_scno.c (arch_get_scno): Likewise.
+	* linux/s390/get_syscall_args.c (get_syscall_args): Likewise.
+	* linux/s390/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/s390/set_scno.c (arch_set_scno): Likewise.
+	* linux/s390x/arch_regs.c (psw_compat_t, s390_compat_regs,
+	s390x_regs_union, s390_frame_ptr, s390x_frame_ptr, s390x_io): New
+	variables.
+	(s390_regset, s390x_regset, ARCH_REGS_FOR_GETREGSET,
+	ARCH_IOVEC_FOR_GETREGSET, ARCH_PC_REG, ARCH_PERSONALITY_0_IOV_SIZE,
+	ARCH_PERSONALITY_1_IOV_SIZE): New macros.
+	* linux/s390x/arch_regs.h (s390_frame_ptr, s390x_frame_ptr): New
+	prototypes.
+	* linux/s390x/arch_rt_sigframe.c: Conditionalize on tcp->currpers.
+	* linux/s390x/arch_sigreturn.c: Likewise.
+	* linux/s390x/get_error.c: Likewise.
+	* linux/s390x/get_scno.c: Likewise.
+	* linux/s390x/get_syscall_args.c: Likewise.
+	* linux/s390x/set_error.c: Likewise.
+	* linux/s390x/set_scno.c: Likewise.
+	* linux/s390x/errnoent1.h: New file.
+	* linux/s390x/ioctls_arch1.h: Likewise.
+	* linux/s390x/ioctls_inc1.h: Likewise.
+	* linux/s390x/signalent1.h: Likewise.
+	* linux/s390x/syscallent1.h: Likewise.
+	* Makefile.am (EXTRA_DIST): Add new files added to linux/s390x.
+	* supported_personalities.h [S390X] (SUPPORTED_PERSONALITIES): Define
+	to 2.
+	* tests/strace-V.test: Add s390 to the list of architectures that have
+	m32 personality.
+	* linux/s390/arch_defs.h (HAVE_ARCH_OLD_MMAP_PGOFF): New macro.
+	* linux/s390x/arch_defs.h: Likewise.
+	* mem.c: Replace #ifdef S390 with #ifdef HAVE_ARCH_OLD_MMAP_PGOFF.
+	* pathtrace.c: Likewise.
+
+2018-01-18  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update NEWS.
+
+2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: check path tracing of ppoll syscall.
+	* tests/ppoll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
+	is not available.  Add a test call that use PATH_TRACING_FD.
+	(main): Conditionalize expected output for those calls
+	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
+	* tests/ppoll-P.c: New file.
+	* tests/pure_executables.list: Add ppoll-P.
+	* tests/.gitignore: Likewise.
+	* tests/gen_tests.in (ppoll-P): New entry.
+
+	tests: check path tracing of poll syscall.
+	* tests/poll.c (main) [PATH_TRACING_FD]: Skip if /proc/self/fd/
+	is not available.  Add tests calls that use PATH_TRACING_FD.
+	(main): Conditionalize expected output for those calls
+	that do not use PATH_TRACING_FD with [!PATH_TRACING_FD].
+	* tests/poll-P.c: New file.
+	* tests/pure_executables.list: Add poll-P.
+	* tests/.gitignore: Likewise.
+	* tests/poll-P.test: New test.
+	* tests/Makefile.am (DECODER_TESTS): Add poll-P.test.
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: enable old_mmap-P.test on s390x.
+	As s390x is the only 64-bit architecture that has old_mmap,
+	the test needs some adjustments there.
+
+	* tests/old_mmap.c: Update condition.
+	(main): Change int types to long, extend numerals to 64 bit, change
+	printing format qualifiers to corresponding long types.
+
+	Co-Authored-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check path tracing of old mmap syscall.
+	* tests/old_mmap.c [!TEST_FD]: Define TEST_FD.
+	(main) <args1_c>: Replace 5th argument with TEST_FD.
+	(main): Wrap the output for the calls that do not use TEST_FD
+	with #ifndef PATH_TRACING.
+	* tests/old_mmap-P.c: New file.
+	* tests/pure_executables.list: Add old_mmap-P.
+	* tests/.gitignore: Likewise.
+	* tests/gen_tests.in: Add old_mmap-P test.
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Fix pathtrace for old_mmap/old_mmap_pgoff.
+	As these system calls have only one argument that points to the
+	location in memory containing actual arguments, current path tracing
+	implementation is incorrect.  In order to fix this, let's use recently
+	introduced fetch_old_mmap_args in order to get actual arguments suitable
+	for path matching.
+
+	* pathtrace.c [HAVE_ARCH_OLD_MMAP] <case SEN_old_mmap,
+	case SEN_old_mmap_pgoff>: Retrieve actual old_mmap arguments with
+	fetch_old_mmap_args, pass the value from the retrieved args if it's
+	available.
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Test non-verbose old_mmap output.
+	* tests/old_mmap-v-none.c: New file.  Include old_mmap.c.
+	* tests/pure_executables.list: Add old_mmap-v-none.
+	* tests/.gitignore: Likewise.
+	* tests/gen_tests.in (old_mmap-v-none): New entry.
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	mem.c: use runtime check in fetch_old_mmap_args.
+	This makes code a bit cleaner and makes it compatible with the upcoming
+	s390x compat support.
+
+	* mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): Replace
+	ANY_WORDSIZE_LESS_THAN_KERNEL_LONG check with current_wordsize == 4
+	check.
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	mem.c: introduce fetch_old_mmap_args.
+	Move common old_mmap/old_mmap_pgoff argument fetching code into a
+	separate function.
+
+	As it is, it also fixes the case of non-verbose printing of old_mmap
+	arguments (see the new test in the next commit).  Also, it is a
+	preparation for the fix of path tracing for these syscalls.
+
+	* defs.h [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New prototype.
+	* mem.c [HAVE_ARCH_OLD_MMAP] (fetch_old_mmap_args): New function.
+	[HAVE_ARCH_OLD_MMAP] (old_mmap, old_mmap_pgoff): Use it.
+
+	Fixes: 3db07f11 "Fix old_mmap output when mmap arguments are unfetchable"
+	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-17  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Introduce arch-specific define HAVE_ARCH_OLD_MMAP.
+	* linux/arch_defs.h: New file.
+	* linux/aarch64/arch_defs.h: New file.  Define HAVE_ARCH_OLD_MMAP.
+	* linux/arm/arch_defs.h: Likewise.
+	* linux/i386/arch_defs.h: Likewise.
+	* linux/m68k/arch_defs.h: Likewise.
+	* linux/s390/arch_defs.h: Likewise.
+	* linux/s390x/arch_defs.h: Likewise.
+	* linux/x32/arch_defs.h: Likewise.
+	* linux/x86_64/arch_defs.h: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* defs.h: Include "arch_defs.h"
+	* mem.c: Replace condition for SYS_FUNC(old_mmap) with #ifdef
+	HAVE_ARCH_OLD_MMAP.
+
+	Suggested-by: Dmitry V. Levin <ldv@altlinux.org>
+
+2018-01-17  Dmitry V. Levin  <ldv@altlinux.org>
+	    Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>
+
+	tests: improve descriptor set syntax testing.
+	* tests/filtering_fd-syntax.test: New file.
+	* tests/options-syntax.test: Move descriptor set syntax testing
+	to filtering_fd-syntax.test.
+	* tests/Makefile.am (MISC_TESTS): Add filtering_fd-syntax.test.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.c: print correct out file name in error messages in case of -ff.
+	* strace.c (outf_perror): New function.
+	(tvprintf, tprints, flush_tcp_output): Use it.
+
+	aarch64: use ARCH_SET_PERSONALITY_FROM_IOV_SIZE.
+	* linux/aarch64/arch_regs.c (ARCH_PERSONALITY_0_IOV_SIZE,
+	ARCH_PERSONALITY_1_IOV_SIZE): New macros.
+	* linux/aarch64/get_scno.c (arch_get_scno): Do not call
+	update_personality as it is handled by the generic get_regs code now.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: add ability to set personality based on GETREGSET iov size.
+	Some architectures (aarch64, s390x) use only PTRACE_GETREGSET interface
+	and use its size to detect current personality. Let's generalise this
+	approach and also avoid subtle errors when we get register but forget to
+	update personality, at least for those architectures.
+
+	Note that in order to employ this behaviour, architecture has to use
+	PTRACE_GETREGSET exclusively (no HAVE_GETREGS_OLD) and should declare
+	appropriate ARCH_PERSONALITY_*_IOV_SIZE macros.
+
+	* syscall.c (get_regs) [ptrace_getregset_or_getregs &&
+	!HAVE_GETREGS_OLD]: Call update_personality based on the value returned
+	in the iov_len field by PTRACE_GETREGSET.  Warn once if the returned
+	iov_len is unknown.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: add sanity check for the target personality number.
+	We can never be cautious enough.
+
+	* defs.h (set_personality): Change argument type to unsigned int.
+	* syscall.c (set_personality): Change argument type to unsigned int,
+	check whether requested personality is sane, die otherwise.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: move current_personality check to set_personality.
+	As all the personality-dependent entries are initially in sync, we can
+	move the check whether we are setting the same personality as we
+	currently are inside set_personality out of update_personality.
+
+	* syscall.c (current_wordsize, current_klongsize): Initialise to 0'th
+	personality value in order to make the statement about "all the
+	personality-dependent entries are initially in sync" true.
+	(set_personality): Check whether requested personality differs from
+	current_personality.
+	(update_personality): Call set_personality unconditionally.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: always update tcp->currpers in update_personality.
+	Sometimes (for example, switching from a process with one personality
+	to a process that previously had different personality but returning
+	from execve to that same personality into) it is possible that
+	current_personality is not changed, but tcp->currpers is different.
+	So, let's not return from update_personality and always update
+	tcp->currpers if it differs from the target personality.
+
+	* syscall.c (update_personality): Do not exit early if personality ==
+	current_personality.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update current_personality on tcb switch.
+	* strace.c (set_current_tcp): New function.
+	(printleader, droptcb, print_event_exit, next_event, dispatch_event):
+	Call set_current_tcp instead of setting current_tcp manually.
+
+2018-01-16  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add support for specifying compiler options for mpers builds.
+	Because some architectures are very, very special.
+
+	* configure.ac (cc_flags_m32, cc_flags_mx32): New variables. AC_SUBST
+	them.
+	* m4/mpers.m4 (MPERS_CFLAGS): Use instead of CFLAG, pushdef as
+	$cc_flags_$1.
+	Use mpers_name instead of CFLAG in AC_CACHE_CHECK messages.
+	Pass MPERS_CFLAGS as the second argument to mpers_test.sh
+	* mpers.sh: Add CC_ARCH_FLAGS as the second argument (PARSER_FILE
+	is moved to the third one). Do not expect leading dash in ARCH_FLAG
+	anymore.
+	* mpers_test.sh (mpers_cc_flags): New variable, initialise to the second
+	command line argument.
+	Pass $mpers_name without leading dash to mpers.sh.
+	Pass $mpers_cc_flags as the second argument to mpers.sh ($sample is
+	the third argument now).
+	* Makefile.am (mpers-m%.stamp:): Pass $(mpers_CC_FLAGS) as the second
+	argument to mpers.sh ($$f is now the third argument).
+	($(mpers_m32_targets)): Define target variable mpers_CC_FLAGS with the
+	value of @cc_flags_m32@
+	($(mpers_mx32_targets)): Define target variable mpers_CC_FLAGS with the
+	value of @cc_flags_mx32@
+	* tests/Makefile.am (MERS_CC_FLAGS): New variable.
+	* bootstrap: Append @cc_flags_$1@ to MPERS_CC_FLAGS. Append
+	$(MPERS_CC_FLAGS) to ARCH_MFLAGS.
+
+2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>
+	    Nikolay Marchuk  <marchuk.nikolay.a@gmail.com>
+
+	tests: improve syscall set syntax testing.
+	* tests/filtering_syscall-syntax.test: New file.
+	* tests/options-syntax.test: Move syscall set syntax testing
+	to filtering_syscall-syntax.test.
+	* tests/qual_fault-syntax.test: Likewise.
+	* tests/qual_inject-syntax.test: Likewise.
+	* tests/Makefile.am (MISC_TESTS): Add filtering_syscall-syntax.test.
+
+2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Enhance error diagnostics about invalid syscalls in fault injection syntax
+	Validate syscall set before the whole fault injection syntax.
+
+	* filter_qualify.c (parse_inject_expression): Add const qualifier to
+	return type.  Return an empty string when no syscall set is specified.
+	(qualify_inject_common): Add const qualifier to "name".  Move
+	qualify_syscall_tokens invocation right after parse_inject_expression.
+	* tests/qual_fault-syntax.test: Update expected output.
+	* tests/qual_inject-syntax.test: Likewise.
+
+2018-01-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	basic_filters: use loop initial declarations.
+	* basic_filters.c (qualify_syscall_number, qualify_syscall_regex,
+	lookup_class, qualify_syscall_class, qualify_syscall_tokens,
+	qualify_tokens): Use "for" loop initial declarations.
+
+	filter_qualify: use loop initial declarations.
+	* filter_qualify.c (sigstr_to_uint, find_errno_by_name,
+	parse_inject_expression, qualify_inject_common, qualify): Use "for" loop
+	initial declarations.
+
+	configure: try to set the C compiler mode to accept ISO Standard C.
+	* configure.ac: Use AC_PROG_CC_STDC.
+	* NEWS: Mention this.
+
+2018-01-15  Dmitry V. Levin  <ldv@altlinux.org>
+
+	pathtrace: update the list of unrelated syscalls.
+	* pathtrace.c (pathtrace_match_set) <SEN_accept4, SEN_accept,
+	SEN_signalfd4, SEN_signalfd>: Skip matching.
+
+	basic_filters: move legacy tracing class names to the end of table.
+	* basic_filters.c (lookup_class) <syscall_class>: Move names that do not
+	start with % to the end of table.
+
+	Enhance decoding of mq_* syscalls.
+	* mq.c (SYS_FUNC(mq_open)): Add RVAL_FD to return value.
+	(SYS_FUNC(mq_timedsend), SYS_FUNC(mq_timedreceive), SYS_FUNC(mq_notify),
+	SYS_FUNC(mq_getsetattr)): Print the first argument using printfd.
+	* NEWS: Mention this change.
+	* pathtrace.c (pathtrace_match_set) <SEN_mq_getsetattr, SEN_mq_notify,
+	SEN_mq_open, SEN_mq_timedreceive, SEN_mq_timedsend>: Skip matching.
+	* linux/32/syscallent.h (mq_getsetattr, mq_notify, mq_open,
+	mq_timedreceive, mq_timedsend): Add TD flag.
+	* linux/64/syscallent.h: Likewise.
+	* linux/alpha/syscallent.h: Likewise.
+	* linux/arm/syscallent.h: Likewise.
+	* linux/avr32/syscallent.h: Likewise.
+	* linux/bfin/syscallent.h: Likewise.
+	* linux/crisv10/syscallent.h: Likewise.
+	* linux/hppa/syscallent.h: Likewise.
+	* linux/i386/syscallent.h: Likewise.
+	* linux/ia64/syscallent.h: Likewise.
+	* linux/m68k/syscallent.h: Likewise.
+	* linux/microblaze/syscallent.h: Likewise.
+	* linux/mips/syscallent-n32.h: Likewise.
+	* linux/mips/syscallent-n64.h: Likewise.
+	* linux/mips/syscallent-o32.h: Likewise.
+	* linux/powerpc/syscallent.h: Likewise.
+	* linux/powerpc64/syscallent.h: Likewise.
+	* linux/s390/syscallent.h: Likewise.
+	* linux/s390x/syscallent.h: Likewise.
+	* linux/sh/syscallent.h: Likewise.
+	* linux/sh64/syscallent.h: Likewise.
+	* linux/sparc/syscallent.h: Likewise.
+	* linux/sparc64/syscallent.h: Likewise.
+	* linux/x32/syscallent.h: Likewise.
+	* linux/x86_64/syscallent.h: Likewise.
+	* linux/xtensa/syscallent.h: Likewise.
+
+	Enhance error diagnostics about invalid syscalls in fault injection syntax
+	* basic_filters.c (qualify_syscall_tokens): Remove "name" argument,
+	assume its value is "system call".
+	* filter.h (qualify_syscall_tokens): Remove "name" argument.
+	All callers updated.
+	* tests/qual_fault-syntax.test: Update expected output.
+
+	basic_filters: handle "all" in a more readable way.
+	* basic_filters.c (qualify_syscall_tokens, qualify_tokens): Remove
+	handle_inversion label, handle "all" by invoking invert_number_set_array
+	directly.
+
+	filter: remove redundant braces around single line expressions.
+	* basic_filters.c (qualify_syscall_class, qualify_syscall_name):
+	Rearrange the inner loop body.
+	(qualify_syscall_number, lookup_class, qualify_syscall_tokens,
+	qualify_tokens): Remove redundant braces around single line expressions.
+	* filter_qualify.c (qualify_inject_common): Likewise.
+
+	filter_qualify: move memory allocation from parse_inject_expression.
+	* filter_qualify.c (parse_inject_expression): Replace "s" and "buf"
+	arguments with "str" argument, use it instead of "s" and "*buf".
+	(qualify_inject_common): Rename "buf" to "copy", initialize it to a copy
+	of "str", pass "copy" to parse_inject_expression instead of "str" and
+	"buf".
+
+2018-01-14  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	xlat: update NT_* constants.
+	Update NT_* descriptor types with the values borrowed from
+	kernel's include/uapi/linux/elf.h and glibc's elf.h.
+
+	* xlat/nt_descriptor_types.in (NT_PRSTATUS, NT_FPREGSET, NT_PRPSINFO,
+	NT_PRXREG, NT_TASKSTRUCT, NT_PLATFORM, NT_AUXV, NT_GWINDOWS, NT_ASRS,
+	NT_PSTATUS, NT_PSINFO, NT_PRCRED, NT_UTSNAME, NT_LWPSTATUS,
+	NT_LWPSINFO, NT_PRFPXREG, NT_PRXFPREG, NT_PPC_VMX, NT_PPC_SPE,
+	NT_PPC_VSX, NT_386_TLS, NT_386_IOPERM, NT_X86_XSTATE): Add fallback
+	definitions.
+	(NT_SIGINFO, NT_FILE, NT_PPC_*, NT_S390_*, NT_ARM_*, NT_METAG_*,
+	NT_ARC_V2): New constants.
+	* NEWS: Mention this.
+
+2018-01-13  Dmitry V. Levin  <ldv@altlinux.org>
+
+	configure: use AC_MSG_ERROR and AC_MSG_FAILURE consistently.
+	* configure.ac [$arch = mips]: Use AC_MSG_FAILURE instead of
+	AC_MSG_ERROR when _MIPS_SIM cannot be determined.  Use AC_MSG_ERROR
+	instead of AC_MSG_FAILURE when syscallent stubs cannot be generated.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+	    Dmitry V. Levin  <ldv@altlinux.org>
+
+	configure: add --disable-mpers and --enable-mpers=check options.
+	On architectures supporting multiple personalities, multiple
+	personalities support in strace is required for proper decoding of
+	structures used by tracees with personalities that differ from the
+	personality of strace.
+
+	New configure options control whether multiple personalities support
+	in strace is mandatory, optional, or disabled.
+
+	The default is changed from what is now equivalent of
+	--enable-mpers=check (automatically detect whether required mpers
+	support could be enabled) to --enable-mpers (terminate the build
+	if required mpers support could not be enabled).
+
+	* configure.ac (AC_ARG_ENABLE([mpers])): New option.
+	* m4/mpers.m4 (st_MPERS): Use enable_mpers.  Terminate the build
+	if mpers could not be enabled and enable_mpers==yes.
+	* strace.spec.in: Specify --enable-mpers=check to %configure.
+	* debian/rules (build/Makefile, build64/Makefile): Specify
+	--enable-mpers=check to configure.
+
+	Suggested-by: DJ Delorie <dj@redhat.com>
+
+2018-01-11  Gleb Fotengauer-Malinovskiy  <glebfm@altlinux.org>
+
+	Update ioctl entries from linux v4.15-rc7.
+	* linux/32/ioctls_inc_align16.h: Update from linux v4.15-rc7 using ioctls_gen.sh.
+	* linux/32/ioctls_inc_align32.h: Likewise.
+	* linux/32/ioctls_inc_align64.h: Likewise.
+	* linux/64/ioctls_inc.h: Likewise.
+	* linux/x32/ioctls_inc0.h: Likewise.
+	* NEWS: Mention this.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+	    Dmitry V. Levin  <ldv@altlinux.org>
+
+	Issue a warning when strace lacks tracee personality support.
+	* defs.h (HAVE_PERSONALITY_1_MPERS, HAVE_PERSONALITY_2_MPERS): New
+	macros.
+	* syscall.c (update_personality): Add need_mpers_warning array
+	initialized with mpers support data.  Use it for printing the mpers
+	unavailability warning once per personality.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: add more checks of reboot syscall decoding.
+	In particular, check for the recent fixes in reboot syscall decoder.
+
+	* tests/gen_tests.in (reboot): Provide -s 256 option.
+	* tests/reboot.c (STR32, STR128): New macros.
+	(main): Add more checks.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: use sprintrc in reboot.test.
+	* test/reboot.c (main): Use sprintrc instead of old-style manual
+	printing of return code.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	reboot.c: limit printing of the fourth argument to 255 bytes.
+	The size of kernel buffer is 256 bytes and the last byte is always zero.
+
+	* reboot.c (SYS_FUNC(reboot)): Replace printstr call with printstr_ex
+	with size of 255 and style flag QUOTE_0_TERMINATED.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	reboot.c: use printxval instead of printflags.
+	Numeric arguments of reboot syscall are not flags but magic values.
+
+	* reboot.c (SYS_FUNC(reboot)): Replace printflags with printxval.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Search for <libiberty/demangle.h> in addition to <demangle.h>
+	This is the location where this header is installed on Debian-based
+	systems.
+
+	* configure.ac: Check for libiberty/demangle.h in addition to
+	demangle.h.
+	* unwind.c [USE_DEMANGLE]: Include either <demangle.h> or
+	<libiberty_demangle.h> based on the presence of HAVE_DEMANGLE_H and
+	HAVE_LIBIBERTY_DEMANGLE_H macros.
+
+2018-01-11  Dmitry V. Levin  <ldv@altlinux.org>
+
+	strace.1: fix typo.
+	* strace.1.in (.SH NOTES): Replace prlimit with prlimit64.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Document multiple personalities support.
+	* strace.1.in (.SH "MULTIPLE PERSONALITY SUPPORT"): New section.
+
+	Add indication of mpers support to strace -V output.
+	* strace.c (print_version): Append information about m32 and mx32
+	decoding support.
+	* tests/strace-V.test: Update expected output.
+
+	Provide strace's native arch to the test framework.
+	* configure.ac (arch_native): New variable, set to arch.
+	* tests/Makefile.am (NATIVE_ARCH): New variable, set to @arch_native@.
+	(AM_TEST_LOG_FLAGS): Pass NATIVE_ARCH as STRACE_NATIVE_ARCH environment
+	variable.
+
+	Add indication of optional demangle feature strace -V output.
+	* strace.c (print_version) [USE_DEMANGLE]: Append " stack-demangle"
+	to the features string.
+	* tests/strace-V.test: Update expected output.
+
+	configure.ac: check for mpers support on RISC-V.
+	* confgure.ac (st_MPERS([m32])): Add riscv.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Use xappendstr instead of xsnprintf where suitable.
+	Replace occurrences of
+
+	    outptr += xsnprintf(outptr, sizeof(outstr) - (outptr - outstr), ...)
+
+	with much more sleek
+
+	    outptr = xappendstr(outstr, outptr, ...)
+
+	* desc.c (decode_select): Replace xsnprintf with xappendstr.
+	* open.c (sprint_open_modes): Likewise.
+	* poll.c (decode_poll_exiting): Likewise.
+	* signal.c (sprintsigmask_n): Likewise.
+	* xlat.c (sprintflags): Likewise.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	xstring.h: add xappendstr.
+	Introduce a macro for handling common case of partial writes
+	to a character array.
+
+	* xstring.h (get_pos_diff_): New function.
+	(xappendstr): New macro.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Update perf-related flags.
+	 - PERF_SAMPLE_BRANCH_TYPE_SAVE, added in v4.14-rc1~173^2~33^2~6
+	 - PERF_SAMPLE_PHYS_ADDR, added in v4.14-rc1~173^2~2
+
+	* xlat/perf_branch_sample_type.in (PERF_SAMPLE_BRANCH_TYPE_SAVE): New
+	flag.
+	* xlat/perf_event_sample_format.in (PERF_SAMPLE_PHYS_ADDR): Likewise.
+	* tests/perf_event_open.c: Update expected output.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	perf.c: add support for struct perf_event_attr.namespaces.
+	This field was introduced by linux kernel commit v4.12-rc1~152^2~42^2~10.
+
+	* configure.ac (AC_CHECK_MEMBERS): Add  perf_event_attr.namespaces.
+	* perf_event_struct.h (struct perf_event_attr): Add namespaces field.
+	* perf.c (print_perf_event_attr): Print namespaces field.
+	Update comment for __reserved_1 field.
+	* tests/perf_event_open.c (struct pea_flags): Add namespaces field.
+	(print_event_attr): Update expected output.
+
+2018-01-11  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check decoding of [gs]et_thread_area syscalls on x86.
+	* tests/xet_thread_area_x86.c: New file.
+	* tests/xet_thread_area_x86.test: New test.
+	* tests/Makefile.am (DECODER_TESTS): Add it.
+	* tests/.gitignore: Add xet_thread_area_x86.
+	* tests/pure_executables.list: Likewise.
+
+2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check decoding of modify_ldt with for 4-byte-available user_desc.
+	Since there is possibility now that strace read only entry_number field
+	of the user_desc struct, let's check that it doesn't do it with
+	modify_ldt syscall.
+
+	* tests/modify_ldt.c (main): Add 4-byte-sized tail_alloc'ed variable.
+	Try to provide it as an argument to modify_ldt.
+
+2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Allow separate printing of struct user_desc.entry_number.
+	Kernel reads only entry_number field in the beginning of the
+	get_thread_area syscall handler.  Let's replicate this behaviour.
+
+	* defs.h (enum user_desc_print_filter): New enumeration.
+	(print_user_desc): Add an argument for signalling which part of the
+	structure should be printed.
+	* clone.c (print_tls_arg): Update print_user_desc call.
+	* ldt.c (print_user_desc): Add filter argument.  Print entry_number on
+	entering and the rest on exiting. Store entering value of the
+	entry_number field in order to print the updated value in the impossible
+	case of changed entry_number value.
+	(SYS_FUNC(modify_ldt), SYS_FUNC(set_thread_area)): Update
+	print_user_desc call.
+	(SYS_FUNC(get_thread_area)): Call print_user_desc with
+	USER_DESC_ENTERING format argument on entering and with
+	USER_DESC_EXITING on exiting.
+
+2018-01-10  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: move struct user_desc printing function into a separate file.
+	As part of preparation for the introduction of [gs]et_thread_area test.
+
+	* tests/modify_ldt.c (print_user_desc): Move it ...
+	* tests/print_user_desc.c: ... to new file.
+	* tests/Makefile.am (EXTRA_DIST): Add print_user_desc.c.
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check decoding of modify_ldt syscall.
+	* tests/modify_ldt.c: New file.
+	* tests/gen_tests.in: Add modify_ldt test.
+	* tests/pure_executables.list: Add modify_ldt.
+	* tests/.gitignore: Likewise.
+
+	ldt.c: manually set modify_ldt's error code.
+	* ldt.c (modify_ldt): Move parsing under entering(tcp). Check whether
+	return code is erroneous and set tcp->u_error appropriately along with
+	RVAL_PRINT_ERR_VAL flag.
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	syscall.c: add support for printing return value and error code.
+	Some weird syscalls (like modify_ldt) return value that doesn't indicate
+	an error (less than -4096), but it is, in fact, erroneous (because they
+	decide to clip the return value to 32-bit, for example).
+
+	Add a flag to print decoded error code along with syscall return value.
+
+	* defs.h (RVAL_PRINT_ERR_VAL): New rval flag.
+	* syscall.c (syscall_exiting_trace): Handle it.
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	ldt.c: print the first argument of modify_ldt as int.
+	* ldt.c (SYS_FUNC(modify_ldt)): Print the first argument as %d.
+
+	ldt.c: print lm field for 64-bit tracees.
+	* configure.ac (AC_CHECK_MEMBERS): Add struct user_desc.lm.
+	* ldt.c (print_user_desc) [HAVE_STRUCT_USER_DESC_LM]: Print lm field
+	for non-compat tracees (it is ignored for compat ones).
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	ldt.c: make struct user_desc output more structured.
+	Also, while we are here, let's fix print qualifiers (which should be %u
+	and not %d).
+
+	* ldt.c (print_user_desc): Use PRINT_FIELD_* macros for printing
+	structure.
+	(SYS_FUNC(set_thread_area)): Change field key-value separator from ":"
+	to "=", change print format qualifier from %d to %u.
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	print_fields.h: add PRINT_FIELD_U_CAST.
+	Add a macro for printing fields explicitly casted to specific type.
+	This is useful for bit fields, as otherwise the magic of *_extend_to_*
+	macros breaks.
+
+	* print_field.h (PRINT_FIELD_U_CAST): New macro.
+
+2018-01-08  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	print_fields.h: rename PRINT_FIELD_UID to PRINT_FIELD_ID.
+	As uid is not the only thing that has a special treatment of the -1
+	value (and, as a result, needs special care), let's rename
+	PRINT_FIELD_UID to PRINT_FIELD_ID and make PRINT_FIELD_UID its alias.
+
+	* print_fields.h (PRINT_FIELD_ID): Rename from PRINT_FIELD_UID.
+	(PRINT_FIELD_UID): Define to PRINT_FIELD_ID.
+
+2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Fix build on systems without linux/genetlink.h.
+	* socketutils.c [!HAVE_LINUX_GENETLINK_H] (genl_families_xlat): Add
+	tcp argument.
+
+	Fixes: v4.20-134-gc46fefc ("Add tcp arguments to netlink calls")
+
+2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	count.c: whitespace.
+
+	count.c: cleanup types and sizeof usage.
+	* count.c (call_summary_pers): Change the type of sorted_count
+	to "unsigned int *".  Replace sizeof(int) with  sizeof(sorted_count[0]).
+	Change the type of idx to unsigned int.
+
+2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	count.c: collect definitions of format strings in one place.
+	In an attempt to make it more readable.
+
+	* count.c (call_summary_pers): Put all format strings in static
+	constants. Use them.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Add tcp arguments to netlink calls.
+	Since they call tracee-specific socket/sendmsg/recvmsg, we'd like to
+	pass tcp there.
+
+	* defs.h (genl_families_xlat): Add tcp argument.
+	* netlink.c (decode_nlmsg_type_default, decode_nlmsg_type_generic,
+	decode_nlmsg_type_netfilter, typedef nlmsg_types_decoder_t): Likewise.
+	(decode_nlmsg_type): Add tcp argument. Pass tcp to decoder call.
+	(print_nlmsghdr): Pass tcp to the decode_nlmsg_type call.
+	* socketutils.c (send_query, receive_responses): Add tcp argument.
+	(inet_send_query, unix_send_query, netlink_send_query, ): Add tcp argument.
+	Pass tcp to the send_query call.
+	(unix_get): Add tcp argument. Pass tcp to the unix_send_query and
+	receive_responses calls.
+	(inet_get): Add tcp argument. Pass tcp to the inet_send_query and
+	receive_responses calls.
+	(tcp_v4_get, udp_v4_get, tcp_v6_get, udp_v6_get): Add tcp argument. Pass
+	tcp to the inet_get call.
+	(netlink_get): Add tcp argument. Pass tcp to the netlink_send_query and
+	receive_responses calls.
+	(protocols): Add tcp argument to the get field.
+	(get_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
+	the protocols[].get calls.
+	(print_sockaddr_by_inode_uncached): Add tcp argument. Pass tcp to
+	the get_sockaddr_by_inode_uncached call.
+	(get_sockaddr_by_inode): Pass tcp to the get_sockaddr_by_inode_uncached
+	call.
+	(print_sockaddr_by_inode): Pass tcp to the
+	print_sockaddr_by_inode_uncached call.
+	(genl_send_dump_families): Add tcp argument. Pass tcp to the send_query
+	call.
+	(genl_families_xlat): Add tcp argument. Pass tcp to the
+	genl_send_dump_families and receive_responses calls.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Add tcp argument to clear_regs.
+	* defs.h (clear_regs): Add argument struct tcb *tcp.
+	* syscall.c (clear_regs): Likewise.
+	* strace.c (next_event): Pass tcp to clear_regs() call.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Pass tcp argument to get_optmem_max/read_int_from_file.
+	In preparation to passing tcp to all tracee-related syscalls.
+
+	* defs.h (read_int_from_file): Add "struct tcb *" as the first argument.
+	* util.c (read_int_from_file): Likewise.
+	* msghdr.c (get_optmem_max): Add "struct tcb *tcp" as the first
+	argument, pass it to read_int_from_file call.
+	(decode_msg_control): Pass tcp to get_optmem_max.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Include paths.h if it is available.
+	Use the OS definition of _PATH_BSHELL macro if it is available.
+
+	* configure.ac (AC_CHECK_HEADERS): Add paths.h.
+	* strace.c [HAVE_PATHS_H]: Include paths.h.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: avoid duplication of a format string in attach_tcb.
+	* strace.c (attach_tcb): Add task_path variable with the output format.
+	Use it for the procdir declaration and xsprintf format string argument.
+
+2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>
+
+	Move syscall_tampered to defs.h.
+	* syscall.c (syscall_tampered): Move ...
+	* defs.h: ... here.
+
+2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>
+
+	strace.c: rename set_sigaction to set_sighandler.
+	Since set_sigaction() actually specifies sa_handler and not sa_sigaction,
+	rename set_sigaction() to set_sighandler() for future definition of
+	set_sigaction() function as specifying sa_sigaction.
+
+	* strace.c (set_sigaction): Rename to set_sighandler.
+	All callers updated.
+
+2018-01-07  Elvira Khabirova  <lineprinter@altlinux.org>
+
+	.gitignore: ignore "gnu" directory created by st_MPERS m4 macro.
+
+	Update .mailmap.
+	* .mailmap (Elvira Khabirova): Add @altlinux.org.
+
+2018-01-07  Chen Jingpiao  <chenjingpiao@gmail.com>
+
+	.mailmap: add canonical name for Chen Jingpiao.
+	* .mailmap: Add canonical name for Chen Jingpiao.
+
+2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>
+
+	personality.c: use sprintxval.
+	* personality.c (SYS_FUNC(personality)): Use sprintxval instead of local
+	implementation.
+
+2018-01-07  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	xlat.c: add sprintxval for printing xval to string.
+	* defs.h (sprintxval): New declaration.
+	(sprintxval): New function.
+
+2018-01-07  Dmitry V. Levin  <ldv@altlinux.org>
+
+	desc.c: use xsnprintf instead of sprintf.
+	* desc.c: Include "xstring.h".
+	(decode_select): Replace sprintf with xsnprintf.
+
+	xlat.c: use xsnprintf instead of sprintf.
+	* xlat.c: Include "xstring.h".
+	(sprintflags): Replace sprintf with xsnprintf.
+
+	open.c: use xsnprintf instead of sprintf.
+	* open.c: Include "xstring.h".
+	(sprint_open_modes): Replace sprintf with xsnprintf.
+
+	poll.c: use xs*printf instead of sprintf.
+	* poll.c: Include "xstring.h".
+	(decode_poll_exiting): Replace sprintf with xsnprintf and xsprintf.
+
+	signal.c: use xs*printf instead of sprintf.
+	* signal.c: Include "xstring.h".
+	(signame): Replace sprintf with xsprintf.
+	(sprintsigmask_n): Replace sprintf with xsnprintf.
+
+	print_timeval.c: use xsprintf instead of snprintf.
+	* print_timeval.c: Include "xstring.h".
+	(sprint_timeval, sprint_timeval32): Replace snprintf with xsprintf.
+
+	print_timespec.c: use xsprintf instead of snprintf.
+	* print_timespec.c: Include "xstring.h".
+	(sprint_timespec): Replace snprintf with xsprintf.
+
+	mmsghdr.c: use xsprintf instead of snprintf.
+	* mmsghdr.c: Include "xstring.h".
+	(SYS_FUNC(recvmmsg)): Replace snprintf with xsprintf.
+
+	socketutils.c: use xsprintf instead of snprintf.
+	* socketutils.c: Include "xstring.h".
+	(unix_parse_response): Replace snprintf with xsprintf.
+
+	alpha.c: use xsprintf instead of snprintf.
+	* alpha.c: Include "xstring.h".
+	(decode_getxxid): Replace snprintf with xsprintf.
+
+	v4l2.c: use xsprintf instead of sprintf.
+	* v4l2.c: Include "xstring.h".
+	(print_v4l2_create_buffers): Replace sprintf with xsprintf.
+
+	util.c: use x*sprintf instead of s*printf.
+	* util.c: Include "xstring.h".
+	(sprinttime_ex): Replace snprintf with xsnprintf.
+	(getfdproto): Replace sprintf with xsprintf.
+
+	unwind.c: use xsprintf instead of sprintf.
+	* unwind.c: Include "xstring.h".
+	(build_mmap_cache): Replace sprintf with xsprintf.
+
+	syscall.c: use xsprintf instead of sprintf.
+	* syscall.c: Include "xstring.h".
+	(get_scno): Replace sprintf with xsprintf.
+
+	resource.c: use xsprintf instead of sprintf.
+	* resource.c: Include "xstring.h".
+	(sprint_rlim64, sprint_rlim32): Replace sprintf with xsprintf.
+
+	pathtrace.c: use xsprintf instead of sprintf.
+	* pathtrace.c: Include "xstring.h".
+	(getfdpath): Replace sprintf with xsprintf.
+
+2018-01-07  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	ldt.c: replace sprintf with xsprintf.
+	* ldt.c: Include "xstring.h".
+	(SYS_FUNC(set_thread_area)): Replace sprintf with xsprintf.
+
+2018-01-05  Dmitry V. Levin  <ldv@altlinux.org>
+
+	strace.c: use xsprintf instead of sprintf.
+	* strace.c: Include "xstring.h".
+	(strerror, newoutf, attach_tcb, print_debug_info): Replace sprintf
+	with xsprintf.
+
+2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	ioprio.c: use xsprintf instead of sprintf.
+	* ioprio.c: Include "xstring.h".
+	(sprint_ioprio): Replace sprintf with xsprintf.
+
+2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Introduce hardened xsprintf/xsnprintf macros.
+	Let's try to future/fool-proof code a bit by introducing variants
+	of sprintf/snprintf that die if an overflow (or an error) occurs.
+	They are deemed to be the default choice for printing to some local
+	string buffer where no sensible error handling is implemented.
+
+	* xstring.h: New file.
+	* Makefile.am (strace_SOURCES): Add it.
+
+2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	count.c: use %9.u conversion specification.
+	Instead of printing to a temporary string.  This also fixes a subtle bug
+	when the output for a billion errors and more is cut and shown
+	incorrectly.
+
+	* count.c (struct call_counts): Change type of calls and errors fields
+	to unsigned int since they are used and printed as unsigned anyway.
+	(call_summary_pers): Remove error_str.  Print cc->errors
+	and error_cum using %9.u conversion specification.
+
+2018-01-05  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	count.c: use personality_names in call_summary report caption.
+	Otherwise the title is quite misleading for x32 personality.
+
+	* count.c (call_summary): Use personality_names.
+
+2018-01-05  Victor Krapivensky  <krapivenskiy.va@phystech.edu>
+
+	Move personality names to a global variable.
+	This is a part of "Prepare for adding support for Lua scripting"
+	commit.
+
+	* defs.h (personality_names): New external constant declaration.
+	* syscall.c: (personality_names): New global variable.
+	(update_personality): Use personality_names for reporting personality
+	name.
+
+	Co-Authored-by: Eugene Syromyatnikov <evgsyr@gmail.com>
+
+2018-01-04  Lubomir Rintel  <lkundrak@v3.sk>
+
+	strace.spec.in: include Bluetooth headers for AF_BLUETOOTH sockets decoding
+	* strace.spec.in (BuildRequires): Add pkgconfig(bluez).
+
+2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Lift artificial limit on output file names in -ff mode.
+	Starting with commit v4.5.19~88 strace imposed an artificial limit
+	on output file names in -ff mode, leading to the following absurd
+	behaviour:
+
+	$ strace -ff -o"$(perl -e 'print "/" x 510')/$PWD/log" /bin/true
+	strace: Can't fopen '////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////.12345': Permission denied
+
+	* strace.c (newoutf): Raise buffer size to PATH_MAX.
+	(init) <followfork >= 2>: Check output file name prefix length.
+	* tests/options-syntax.test: Check it.
+
+2018-01-04  Dmitry V. Levin  <ldv@altlinux.org>
+
+	configure.ac: fix typo.
+	* configure.ac: Replace CPPFALGS with CPPFLAGS.
+
+	Fixes: v4.20-85-gf9c8e8a ("unwind: demangle symbol names")
+
+2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Change the first argument of upeek from pid to tcp.
+	All users were changed automatically by:
+
+		for i in `git grep -l 'upeek(tcp->pid'`; do \
+			sed -i 's/upeek(tcp->pid/upeek(tcp/g' "$i"; \
+		done
+
+	* upeek.c (upeek): Change the first argument from pid_t pid to struct
+	tcb *tcp. Use tcp->pid instead of pid in the function's body.
+	* defs.h (upeek): Update declaration.
+	* linux/alpha/arch_getrval2.c: Pass tcp instead of tcp->pid to the
+	upeek calls.
+	* linux/alpha/arch_rt_sigframe.c: Likewise.
+	* linux/alpha/arch_sigreturn.c: Likewise.
+	* linux/alpha/get_scno.c: Likewise.
+	* linux/alpha/get_syscall_args.c: Likewise.
+	* linux/alpha/get_syscall_result.c: Likewise.
+	* linux/bfin/arch_rt_sigframe.c: Likewise.
+	* linux/bfin/get_scno.c: Likewise.
+	* linux/bfin/get_syscall_args.c: Likewise.
+	* linux/bfin/get_syscall_result.c: Likewise.
+	* linux/crisv10/arch_rt_sigframe.c: Likewise.
+	* linux/crisv10/get_scno.c: Likewise.
+	* linux/crisv10/get_syscall_args.c: Likewise.
+	* linux/crisv10/get_syscall_result.c: Likewise.
+	* linux/hppa/arch_rt_sigframe.c: Likewise.
+	* linux/hppa/get_scno.c: Likewise.
+	* linux/hppa/get_syscall_args.c: Likewise.
+	* linux/hppa/get_syscall_result.c: Likewise.
+	* linux/microblaze/arch_rt_sigframe.c: Likewise.
+	* linux/microblaze/arch_sigreturn.c: Likewise.
+	* linux/microblaze/get_scno.c: Likewise.
+	* linux/microblaze/get_syscall_args.c: Likewise.
+	* linux/microblaze/get_syscall_result.c: Likewise.
+	* linux/powerpc/getregs_old.c: Likewise.
+	* linux/sh/arch_getrval2.c: Likewise.
+	* linux/sh/arch_rt_sigframe.c: Likewise.
+	* linux/sh/get_scno.c: Likewise.
+	* linux/sh/get_syscall_args.c: Likewise.
+	* linux/sh/get_syscall_result.c: Likewise.
+	* linux/sh64/get_scno.c: Likewise.
+	* linux/sh64/get_syscall_args.c: Likewise.
+	* linux/sh64/get_syscall_result.c: Likewise.
+	* linux/xtensa/arch_rt_sigframe.c: Likewise.
+	* linux/xtensa/get_scno.c: Likewise.
+	* linux/xtensa/get_syscall_args.c: Likewise.
+	* linux/xtensa/get_syscall_result.c: Likewise.
+	* syscall.c: Likewise.
+
+2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Change argument of getregs_old from pid to tcp.
+	* linux/powerpc/getregs_old.c (getregs_old): Change the first argument
+	from pid_t pid to struct tcb *tcp. Replace all instances of pid with
+	tcp->pid.
+	* linux/x86_64/getregs_old.c (getregs_old): Likewise.
+	* linux/x86_64/getregs_old.h (getregs_old): Update declaration.
+	* syscall.c (get_regs) [HAVE_GETREGS_OLD]: Pass tcp to the getregs_old
+	call instead of tcp->pid.
+
+2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Change the first argument of upoke from pid to tcp.
+	Users were updated automatically by:
+
+		for i in `git grep -l 'upoke(tcp->pid'`; do \
+			sed -i 's/upoke(tcp->pid/upoke(tcp/g' "$i"; \
+		done
+
+	* upoke.c (upoke): Change the first argument from pid_t pid to struct
+	tcb *tcp. Use tcp->pid instead of pid in the function's body.
+	* defs.h (upoke): Update declaration.
+	* linux/alpha/set_error.c (arch_set_error, arch_set_success): Provide
+	tcp in the first argument of the upoke call instead of tcp->pid.
+	* linux/alpha/set_scno.c (arch_set_scno): Likewise.
+	* linux/bfin/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/bfin/set_scno.c (arch_set_scno): Likewise.
+	* linux/crisv10/set_error.c (arch_set_error, arch_set_success):
+	Likewise.
+	* linux/crisv10/set_scno.c (arch_set_scno): Likewise.
+	* linux/hppa/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/hppa/set_scno.c (arch_set_scno): Likewise.
+	* linux/i386/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/i386/set_scno.c (arch_set_scno): Likewise.
+	* linux/microblaze/set_error.c (arch_set_error, arch_set_success):
+	Likewise.
+	* linux/microblaze/set_scno.c (arch_set_scno): Likewise.
+	* linux/powerpc/set_error.c (arch_set_error, arch_set_success):
+	Likewise.
+	* linux/powerpc/set_scno.c (arch_set_scno): Likewise.
+	* linux/sh/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/sh/set_scno.c (arch_set_scno): Likewise.
+	* linux/sh64/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/sh64/set_scno.c (arch_set_scno): Likewise.
+	* linux/x86_64/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/x86_64/set_scno.c (arch_set_scno): Likewise.
+	* linux/xtensa/set_error.c (arch_set_error, arch_set_success): Likewise.
+	* linux/xtensa/set_scno.c (arch_set_scno): Likewise.
+
+2018-01-03  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	Move enum trace_event into a separate header.
+	As it will have users outside strace.c in the future.
+
+	* trace_event.h (enum trace_event): Move it from...
+	* strace.c (enum trace_event): ...here.
+	(#include "trace_event.h"): New header, for enum trace_event.
+	* Makefile.am (strace_SOURCES): Add trace_event.h.
+
+2018-01-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Call get_scno during startup_tcb only for forcibly attached processes.
+	Otherwise it makes little sense on most arches to try to get syscall
+	number.
+
+	* defs.h (TCB_GRABBED): New tcb flag.
+	* strace.c (attach_tcb): Set TCB_GRABBED for the tcb.
+	(startup_tcb): Call get_scno() only if process is grabbed and its
+	registers may contain syscall number information.
+
+	Reported-by: Dmitry V. Levin <ldv@altlinux.org>
+	Closes: https://github.com/strace/strace/issues/22
+
+2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.c: sort getopt switch branches alphabetically.
+	There's no reason to have them out of order. This also (almost) matches
+	their order in the getopt call argument, introduced in
+	v4.20-64-g61c03be.
+
+	* strace.c (init): Sort branches in the getopt switch routine.
+
+2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.c: check for (non)zero argc instead of argv[0]
+	Since we can never be sure that we have NULL behind the last entry of
+	the argv array.
+
+	* strace.c (init): Check for non-zero argc before/instead of argv[0].
+
+2018-01-01  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.1: advertise strace-log-merge.
+	In order to raise awareness about strace-log-merge, mention it in
+	SEE ALSO section and -ff option description.
+
+	* strace.1.in (.SS Filtering) <.TP .B \-ff>: Mention strace-log-merge.
+	(.SH "SEE ALSO"): Likewise.
+
+2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>
+
+	unwind: demangle function arguments.
+	* unwind.c (print_stack_frame): Specify demangling style.
+	* tests/strace-k.test (result): Update regexp.
+	* tests/strace-k-demangle.test (expected): Update expected output.
+
+	tests: check strace -k symbol names demangling.
+	* tests/strace-k-demangle.test: New test.
+	* tests/stack-fcall-mangled.c: New file.
+	* tests/stack-fcall-mangled-0.c: Likewise.
+	* tests/stack-fcall-mangled-1.c: Likewise.
+	* tests/stack-fcall-mangled-2.c: Likewise.
+	* tests/stack-fcall-mangled-3.c: Likewise.
+	* tests/stack-fcall.h [MANGLE] (f0, f1, f2, f3): New macros.
+	* tests/.gitignore: Add stack-fcall-mangled.
+	* tests/Makefile.am (check_PROGRAMS): Likewise.
+	(stack_fcall_mangled_SOURCES): New variable.
+	(EXTRA_DIST): Add strace-k-demangle.test.
+	[USE_LIBUNWIND && USE_DEMANGLE] (LIBUNWIND_TESTS): Likewise.
+
+2017-12-29  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: parametrize strace-k.test.
+	Prepare for the check of strace -k symbol names demangling.
+
+	* tests/strace-k.test: Parametrize $test_prog and $expected.
+	* tests/stack-fcall.h: New file.
+	* tests/stack-fcall.c: Include "stack-fcall.h"
+	* tests/stack-fcall-0.c: Likewise.
+	* tests/stack-fcall-1.c: Likewise.
+	* tests/stack-fcall-2.c: Likewise.
+	* tests/stack-fcall-3.c: Likewise.
+	* tests/Makefile.am (EXTRA_DIST): Add stack-fcall.h.
+
+2017-12-26  Masatake YAMATO  <yamato@redhat.com>
+
+	unwind: demangle symbol names.
+	Implement demangling of C++ symbol names in stack trace
+	using cplus_demangle function from GNU libiberty library.
+
+	This is an example demangled stack trace output:
+
+	fstat(5, {st_mode=S_IFREG|0664, st_size=0, ...}) = 0
+	 > /usr/lib64/libc-2.25.so(__fxstat64+0x12) [0xffd62]
+	 > /usr/lib64/libc-2.25.so(_IO_file_doallocate+0x5f) [0x717ff]
+	 > /usr/lib64/libc-2.25.so(_IO_doallocbuf+0x79) [0x81699]
+	 > /usr/lib64/libc-2.25.so(_IO_file_overflow+0x198) [0x807b8]
+	 > /usr/lib64/libc-2.25.so(_IO_file_xsputn+0xbd) [0x7ed5d]
+	 > /usr/lib64/libc-2.25.so(fwrite_unlocked+0x60) [0x7d800]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::EnvWrapper::StartThread+0x3b6) [0x48656]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::EmitPhysicalRecord+0x89) [0x28bc9]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::log::Writer::AddRecord+0x9e) [0x28d9e]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Write+0x208) [0x1ce18]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::DB::Put+0x59) [0x192b9]
+	 > /usr/lib64/libleveldb.so.1.18(leveldb::DBImpl::Put+0x1d) [0x1931d]
+	 > /home/yamato/var/leveldb/doc/a.out(main+0x120) [0x1107]
+	 > /usr/lib64/libc-2.25.so(__libc_start_main+0xea) [0x2088a]
+	 > /home/yamato/var/leveldb/doc/a.out(_start+0x2a) [0xf3a]
+
+	* Makefile.am [USE_DEMANGLE] (strace_CPPFLAGS, strace_LDFLAGS,
+	libiberty_LDADD): Append libiberty_CPPFLAGS, strace_LDFLAGS, and
+	libiberty_LIBS, respectively.
+	* configure.ac: Add --with-libiberty option.  Check cplus_demangle
+	support in libiberty.
+	* unwind.c [USE_DEMANGLE]: Include <demangle.h>.
+	(print_stack_frame) [USE_DEMANGLE]: Use cplus_demangle.
+
+2017-12-26  Masatake YAMATO  <yamato@redhat.com>
+
+	Define macros for renaming xmalloc and xcalloc.
+	I'm planning to link strace with libiberty for mangling C++
+	symbol names in stack trace enabled with -k option.
+
+	Both names, xmalloc and xcalloc, are already defined and used
+	in libiberty, and they conflict with functions in strace.
+	Rename xmalloc and xcalloc functions defined in strace
+	to strace_xmalloc and strace_xcalloc, respectively,
+	to avoid this conflict.
+
+	* xmalloc.h (xcalloc, xmalloc): New macros.
+
+2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	syscall: move a sparc specific include to an arch specific file.
+	* syscall.c [SPARC64]: Do not include <asm/psrcompat.h>.
+	[SPARC]: Do not include <asm/psr.h>.
+	* linux/sparc/get_error.c: Include <asm/psr.h>.
+
+	syscall: move all ia64 specific includes to an arch specific file.
+	* syscall.c [IA64]: Remove.
+	* linux/ia64/get_syscall_args.c: Include <asm/rse.h>.
+
+	syscall: simplify get_syscall_result.
+	* syscall.c [ptrace_getregset_or_getregs] (get_syscall_result_regs):
+	Define to get_regs.
+	(get_syscall_result): Use get_syscall_result_regs unconditionally.
+
+2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	syscall: change get_regs argument type.
+	This opens the way for future changes related to get_regs.
+
+	* syscall.c (get_regs): Change argument type from "pid_t"
+	to "struct tcb *", all callers changed.
+
+2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	syscall: move get_regs call from syscall_exiting_decode to get_syscall_result
+	This make the code less confusing and opens the way for future changes
+	related to get_regs.
+
+	* syscall.c (syscall_exiting_decode): Move get_regs invocation ...
+	(get_syscall_result) [ptrace_getregset_or_getregs]: ... here.
+
+2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	syscall: rework subcall decoding on mips o32.
+	Move syscall subcall handling to the same switch statement that
+	handles ipc and socket subcalls.
+
+	* linux/mips/syscallent-o32.h [LINUX_MIPSO32] (SYS_syscall_subcall):
+	Define.
+	* syscall.c (decode_mips_subcall): Rename to decode_syscall_subcall,
+	conditionalize on SYS_syscall_subcall instead of LINUX_MIPSO32.
+	(syscall_entering_decode) [LINUX_MIPSO32]: Remove.
+	(syscall_entering_decode) [SYS_syscall_subcall]: Handle SEN_syscall
+	using decode_syscall_subcall.
+
+2017-12-24  Dmitry V. Levin  <ldv@altlinux.org>
+
+	syscall: tweak shuffle_scno ifdefery.
+	* syscall.c (shuffle_scno): Check for ARM_FIRST_SHUFFLED_SYSCALL
+	instead of ARM || AARCH64.  This does not result to any code change
+	but looks more comprehensible.
+
+	syscall: change get_regs to return an error code.
+	* syscall.c (get_regs_error) [!ptrace_getregset_or_getregs]: Do not
+	define.
+	(clear_regs) [!ptrace_getregset_or_getregs]: Do not set get_regs_error.
+	(get_regs) [ptrace_getregset_or_getregs]: Return get_regs_error, all
+	callers changed to test get_regs return code instead of get_regs_error
+	static variable, which is now internally used by get_regs() and
+	clear_regs() only.
+	(USE_GET_SYSCALL_RESULT_REGS): Do not define.
+	Use "#ifndef ptrace_getregset_or_getregs"
+	instead of "#ifdef USE_GET_SYSCALL_RESULT_REGS".
+
+2017-12-24  Harsha Sharma  <harshasharmaiitr@gmail.com>
+
+	tests: enhance run.sh usage error diagnostics.
+	* tests/run.sh: Execute timeout command only when invoked with
+	an argument, otherwise print an error message.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: skip nsyscalls-d.test on mips o32.
+	On mips o32, nsyscalls test is implemented using syscall #4000,
+	so nsyscalls-d cannot work there.
+
+	* tests/nsyscalls-d.test: Skip on mips o32.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Remove linux/ptp_clock.h.
+	As linux kernel provides a compatible linux/ptp_clock.h header since
+	commit v3.8-rc1~139^2~514, there is no need for a local copy.
+
+	* linux/ptp_clock.h: Remove.
+	* Makefile.am (EXTRA_DIST): Remove it.
+	* configure.ac (AC_CHECK_TYPES): Check for struct ptp_sys_offset
+	in <linux/ptp_clock.h>.
+	* ioctl.c (ioctl_decode) <case '='>: Conditionalize
+	on [HAVE_STRUCT_PTP_SYS_OFFSET].
+	* ptp.c: Likewise.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Remove linux/ubi-user.h.
+	As linux kernel provides a compatible mtd/ubi-user.h header since
+	commit v3.7-rc1~85^2~17, there is no need for a local copy.
+
+	* linux/ubi-user.h: Remove.
+	* Makefile.am (EXTRA_DIST): Remove it.
+	* configure.ac (AC_CHECK_MEMBERS): Check
+	for struct ubi_attach_req.max_beb_per1024 in <mtd/ubi-user.h>.
+	* ioctl.c (ioctl_decode) <case 'o', case 'O'>: Conditionalize
+	on HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024.
+	* ubi.c: Likewise.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Remove linux/mtd-abi.h.
+	As linux kernel provides a compatible mtd/mtd-abi.h header since
+	commit v3.2-rc1~14^2~33, there is no need for a local copy.
+
+	* linux/mtd-abi.h: Remove.
+	* Makefile.am (EXTRA_DIST): Remove it.
+	* configure.ac (AC_CHECK_TYPES): Check for struct mtd_write_req
+	in <mtd/mtd-abi.h>.
+	* ioctl.c (ioctl_decode) <case 'M'>: Conditionalize
+	on [HAVE_STRUCT_MTD_WRITE_REQ].
+	* mtd.c: Likewise.
+	* tests/ioctl_mtd.c: Likewise.
+	* tests/ioctl.c (main): Likewise.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Remove linux/personality.h.
+	* linux/personality.h: Remove.
+	* Makefile.am (EXTRA_DIST): Remove it.
+	* personality.c: Do not include <linux/personality.h>, include
+	"xlat/personality_flags.h" before "xlat/personality_types.h".
+	* xlat/personality_flags.in: Provide fallback definitions.
+	* xlat/personality_types.in: Likewise.
+
+2017-12-23  Dmitry V. Levin  <ldv@altlinux.org>
+
+	travis: switch from clang-3.8 to clang.
+	As travis provides a relatively fresh clang by default nowadays,
+	it makes sense to use default clang in clang-based test builds.
+
+	* .travis.yml (matrix): Change clang-3.8 to clang.
+
+2017-12-21  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.1.in: mention perf and ftrace in SEE ALSO.
+	* strace.1.in (.SH SEE ALSO): Add references to perf-trace(1) and
+	trace-cmd(1).
+
+	strace.1.in: clarify -F option behaviour.
+	* strace.1.in <.TP \-F>: Extend deprecation warning.  Describe behaviour
+	of multiple instances of -F and interoperability of -F and -f.
+
+2017-12-20  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: consistently use $STRACE_EXE instead of local alternatives.
+	* tests/get_regs.test: Replace "${STRACE##* }" with "$STRACE_EXE".
+	* tests/options-syntax.test: Replace "$strace_exp" with "$STRACE_EXE".
+	* tests/syntax.sh: Likewise.
+
+2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>
+	    Dmitry V. Levin  <ldv@altlinux.org>
+
+	strace.c: inform the user about -F option obsolescence.
+	* strace.c (init): Print an error message if the option is used.
+
+2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace.c: sort option arguments alphabetically.
+	Except for the ones that enabled by configure options.
+
+	While we are here, let's also change the indentation of while expression
+	continuation in order to separate it from the following switch clause.
+
+	* strace.c (init): Reorder options in getopt() call.
+
+2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: use _exit() instead of exit() in child's die()
+	Let's keep child's death routine as minimalistic as possible for the
+	cases when vfork() is used instead of fork() on systems that lack MMU.
+
+	* strace.c (die) <!(strace_tracer_pid == getpid())>: Call _exit().
+
+2017-12-20  Harsha Sharma  <harshasharmaiitr@gmail.com>
+
+	syscall: replace if (debug_flag) ... with debug_msg macro.
+	* syscall.c (get_scno): Use debug_msg instead of
+	"if (debug_flag) error_msg".
+
+2017-12-20  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	tests: check (some) debugging output generated during nsyscalls test.
+	* tests/nsyscalls-d.c: New file.
+	* tests/.gitignore: Add it.
+	* tests/nsyscalls-d.test: New test, variant of nsyscalls.test with debug
+	output check.
+	* tests/nsyscalls-nd.test: Likewise.
+	* tests/nsyscalls.c: Add expected debug output.
+	* tests/Makefile.am (check_PROGRAMS): Add nsyscalls-d.
+	(DECODER_TESTS): Add nsyscalls-d.test and nsyscalls-nd.test.
+
+2017-12-20  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	pathtrace.c: use xgrowarray.
+	* defs.h <struct path_set>: Change type of num_selected field to size_t.
+	Add size field.
+	* pathtrace.c (storepath): Rewrite to utilise xgrowarray.
+
+2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>
+
+	dyxlat: use xgrowarray.
+	* dyxlat.c (dyxlat_alloc): Use xgrowarray instead of xcalloc.
+	(dyxlat_add_pair): Use xgrowarray instead of xreallocarray.
+
+	unwind: use xgrowarray.
+	* unwind.c (get_symbol_name): Use xgrowarray instead of manual
+	dynamic array management using xreallocarray.
+
+2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: use xgrowarray.
+	* strace.c (tcbtabsize): Change type to size_t.
+	(expand_tcbtab): Rewrite in order to utilise xgrowarray
+	instead of manual dynamic array management.
+
+	unwind: use xgrowarray.
+	* unwind.c (build_mmap_cache): Use xgrowarray instead of manual dynamic
+	array management.
+
+2017-12-14  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	xmalloc.c: introduce xgrowarray helper function.
+	In order to simplify dynamic array management code.
+
+	* xmalloc.h (xgrowarray): New declaration.
+	* xmalloc.c (xgrowarray): New function.
+
+2017-12-14  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: check error diagnostics when exec file name is too long.
+	* tests/options-syntax.test: Check error diagnostics when
+	exec file name length equals to PATH_MAX.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: minor style fixes.
+	* strace.c (test_ptrace_seize): Remove excess braces.
+	(init): Wrap overly long string literal.  Add braces
+	to the else if branch.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: use *_func_* message printing macros where appropriate.
+	In order to provide some additional bits of information in weird error
+	cases or just replace existing usages of __func__/literal function name.
+
+	* strace.c (detach): Use perror_func_msg() instead of perror_msg().
+	(startup_attach, open_dummy_desc, startup_child, test_ptrace_seize): Use
+	perror_func_msg_and_die() instead of perror_msg_and_die().
+	(test_ptrace_seize): Use error_func_msg_and_die() instead of
+	error_msg_and_die().
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	unwind.c: more verbose mapping overlapping diagnostic message.
+	* unwind.c (build_mmap_cache): Change error_msg() to debug_msg(), add
+	information about region names and the respective start and end
+	addresses.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	unwind.c: non-fatal handling of asprintf error.
+	An error returned by asprintf is a poor excuse for dying.
+
+	* unwind.c (asprintf_error_str): New string constant.
+	(sprint_call_or_error): Replace error_msg_and_die() with
+	perror_func_msg() and usage of asprintf_error_str for a return value.
+	(queue_print): Free tmp->output line only if it is not
+	asprintf_error_str.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	unwind.c: eliminate DPRINTF.
+	Since DPRINTF is simply a macro that provides debugging information
+	along with some information about printing routine call site, now standard
+	debug_func_* macros are deemed to be a suitable replacement.
+
+	* unwind.c (DPRINTF): Remove.
+	(build_mmap_cache, delete_mmap_cache, unwind_cache_invalidate,
+	unwind_print_stacktrace, unwind_captiure_stacktrace): Replace
+	DPRINTF(fmt, str, ...) with debug_func_msg(fmt, ...)/
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	strace.c: replace if (debug_flag) ... with suitable debug printing macros
+	* strace.c (alloc_tcb, droptcb, detach, attach_tcb, test_ptrace_seize,
+	init, startup_tcb): Replace if (debug_flag) error_msg(...) occurrences
+	with debug_error_msg(...).
+	(attach_tcb): Replace if (debug_flag) perror_msg(...) with
+	debug_perror_msg(...).
+	(cleanup, startup_tcb): Replace if (debug_flag) error_msg(...)
+	occurrences with debug_func_msg() in attempt to provide additional
+	information.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	error_prints.h: add *_func_* printing macros.
+	In order to reduce boilerplate for the cases when __func__ is desired
+	to be printed.
+
+	* error_prints.h (error_func_msg, perror_func_msg, debug_func_msg,
+	debug_func_perror_msg, error_func_msg_and_die, perror_func_msg_and_die):
+	New macro definitions.
+
+2017-12-13  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	error_prints.h: add debug print macros.
+	* defs.h (debug_flag): Move the declaration...
+	* error_prints.h (debug_flag): ... here.
+	(debug_msg, debug_perror_msg): New macro definitions.
+	Include <stdbool.h> for the debug_flag declaration.
+
+2017-12-04  Masatake YAMATO  <yamato@redhat.com>
+	    Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: check decoding of KVM ioctl commands.
+	* tests/ioctl_kvm_run.c: New file.
+	* tests/ioctl_kvm_run.test: New test.
+	* tests/Makefile.am (DECODER_TESTS): Add ioctl_kvm_run.test.
+	* tests/pure_executables.list: Add ioctl_kvm_run.
+	* tests/.gitignore: Likewise.
+
+2017-12-04  Masatake YAMATO  <yamato@redhat.com>
+
+	kvm: decode the argument of KVM_{SET, GET}_SREGS ioctl command.
+	* configure.ac (AC_CHECK_TYPES): Add struct kvm_sregs.
+	* kvm.c [HAVE_STRUCT_KVM_SREGS] (kvm_ioctl_decode_sregs): New function.
+	(kvm_ioctl) [HAVE_STRUCT_KVM_SREGS] <KVM_SET_SREGS, KVM_GET_SREGS>:
+	Use it.
+	* linux/arch_kvm.c (arch_print_kvm_sregs): New function.
+	* linux/x86_64/arch_kvm.c (PRINT_FIELD_KVM_SREGS_STRUCT): New macro.
+	(kvm_ioctl_decode_regs_dtable, kvm_ioctl_decode_regs_segment,
+	arch_print_kvm_sregs): New functions.
+
+	kvm: decode the argument of KVM_{SET, GET}_REGS ioctl command.
+	* configure.ac (AC_CHECK_TYPES): Add struct kvm_regs.
+	* linux/arck_kvm.c: New file.
+	* linux/x86_64/arch_kvm.c: Likewise.
+	* linux/i386/arch_kvm.c: Likewise.
+	* linux/x32/arch_kvm.c: Likewise.
+	* Makefile.am (EXTRA_DIST): Add them.
+	* kvm.c: Include "arch_kvm.c".
+	[HAVE_STRUCT_KVM_REGS] (kvm_ioctl_decode_regs): New function.
+	(kvm_ioctl) [HAVE_STRUCT_KVM_REGS] <KVM_SET_REGS, KVM_GET_REGS>: Use it.
+
+	kvm: decode the argument of KVM_SET_USER_MEMORY_REGION ioctl command.
+	* configure.ac (AC_CHECK_TYPES): Add struct kvm_userspace_memory_region.
+	* xlat/kvm_mem_flags.in: New file.
+	* kvm.c: Include print_fields.h.
+	[HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]: Include xlat/kvm_mem_flags.h,
+	(kvm_ioctl_set_user_memory_region): New function.
+	(kvm_ioctl) [HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION]
+	<KVM_SET_USER_MEMORY_REGION>: Use it.
+
+2017-12-03  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	Add strace mascot.
+	* strace.svg: New file.
+
+	Co-Authored-by: Vitaly Chaykovsky <mgspeker@gmail.com>
+
+2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: robustify attach-p-cmd.test against buggy kernels.
+	From time to time various kernels, old and new, just go nuts
+	and fail attach-p-cmd.test with the following diagnostics:
+
+	 12345 --- SIGALRM {si_signo=SIGALRM, si_code=SI_KERNEL} ---
+	-12345 chdir("attach-p-cmd.test -p") = -1 ENOENT (No such file or directory)
+	+12345 syscall_4294967295(0xffe60934, 0x1c0, 0xffe60934, 0x1, 0xffe609b4, 0xffe60a58) = -1 (errno 38)
+	+12345 chdir("attach-p-cmd.test -p") = -1 ENOSYS (Function not implemented)
+
+	Let's workaround this kernel madness by rewriting the test
+	without use of SIGALRM.
+
+	* tests/attach-p-cmd.h: New file.
+	* tests/Makefile.am (EXTRA_DIST): Add attach-p-cmd.h.
+	* tests/attach-p-cmd-cmd.c: Include "attach-p-cmd.h".
+	(write_pidfile, wait_for_peer_invocation): New functions.
+	(main): Use them.
+	* tests/attach-p-cmd-p.c: Include <time.h> and "attach-p-cmd.h".
+	(wait_for_peer_invocation, wait_for_peer_termination): New functions.
+	(main): Use them.  Do not raise SIGALRM, use nanosleep after peer
+	termination.
+
+2017-12-03  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: robustify ipc_msgbuf.test against broken libc.
+	glibc between commits glibc-2.25~130 and glibc-2.26~740 had broken
+	msgctl(IPC_RMID) on hppa: this operation always failed with EINVAL
+	because of inappropriate use of IPC_64 flag.  Similar issues were
+	fixed on other niche architectures.  Let's workaround these issues
+	by skipping the test in case of msgctl(IPC_RMID) failure.
+
+	* tests/ipc_msgbuf.c (cleanup): Change return type to int,
+	return 77 in case of msgctl(IPC_RMID) failure.
+	(main): Explicitly invoke cleanup() at the end.
+
+2017-12-01  Masatake YAMATO  <yamato@redhat.com>
+
+	kvm: decode the argument of KVM_CREATE_VCPU ioctl command.
+	* kvm.c (kvm_ioctl_create_vcpu): New function.
+	(kvm_ioctl) <KVM_CREATE_VCPU>: Use it.
+
+	kvm: handle KVM_CREATE_VM ioctl command.
+	* kvm.c (kvm_ioctl): Handle KVM_CREATE_VM command.
+
+	kvm: handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE, and KVM_GET_API_VERSION ioctl commands
+	* kvm.c (kvm_ioctl): Handle KVM_RUN, KVM_GET_VCPU_MMAP_SIZE,
+	and KVM_GET_API_VERSION commands.
+
+	ioctl: add a stub for decoding kvm related ioctls.
+	* kvm.c: New file.
+	* Makefile.am (strace_SOURCES): Add it.
+	* configure.ac (AC_CHECK_HEADERS): Add linux/kvm.h.
+	* defs.h (kvm_ioctl): New prototype.
+	* ioctl.c (ioctl_decode) HAVE_LINUX_KVM_H]: Use kvm_ioctl.
+
+2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	strace-log-merge: work around corner cases of strace -ttt parsing.
+	Employing strace -ttt for the logs destined to be fed to
+	strace-log-merge is ultimately the best solution except for the logs
+	that pass the following dates:
+
+	Thu Jan  1 00:00:09 UTC 1970
+	Thu Jan  1 00:01:39 UTC 1970
+	Thu Jan  1 00:16:39 UTC 1970
+	Thu Jan  1 02:46:39 UTC 1970
+	Fri Jan  2 03:46:39 UTC 1970
+	Mon Jan 12 13:46:39 UTC 1970
+	Sun Apr 26 17:46:39 UTC 1970
+	Sat Mar  3 09:46:39 UTC 1973
+	Sun Sep  9 01:46:39 UTC 2001
+	Sat Nov 20 17:46:39 UTC 2286
+	Wed Nov 16 09:46:39 UTC 5138
+	Fri Sep 27 01:46:39 UTC 33658
+	Sun May 20 17:46:39 UTC 318857
+	Sat Nov  7 09:46:39 UTC 3170843
+	Sun Jul  5 01:46:39 UTC 31690708
+	Sat Jan 25 17:46:39 UTC 316889355
+
+	Let's lift this limitation.
+
+	* strace-log-merge: Generate numeric-only key for sorting, use sort -n
+	option.
+
+2017-11-30  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	debian: add strace-log-merge to the list of installed files.
+	* debian/strace.install: Add strace-log-merge.
+
+	Add strace-log-merge man page.
+	* strace-log-merge.1.in: New file.
+	* NEWS: Mention this.
+	* .gitignore: Add strace-log-merge.1.
+	* Makefile.am (man_MANS): Likewise.
+	* configure.ac (AC_CONFIG_FILES): Likewise.
+	* debian/strace.manpages: Likewise.
+
+	strace-log-merge: add copyright header.
+
+2017-11-29  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Add initial GitLab CI support.
+	* .gitlab-ci.yml: New file.
+	* travis-build.sh: Print $CC -print-multi-lib.  Print config.log
+	in case of configure failure.
+	* travis-install.sh: Check sudo availability.  Install autoconf,
+	automake, file, gawk, gcc-multilib, git, gzip, make, and xz-utils
+	for all targets.
+	(musl-gcc): Install ca-certificates.
+
+2017-11-25  Dmitry V. Levin  <ldv@altlinux.org>
+
+	mpers: fix cross-compiling.
+	In cross builds, a target version of readelf has to be used
+	instead of a native one.
+
+	* configure.ac (AC_CHECK_TOOL): Add readelf.
+	* Makefile.am (READELF): New variable.
+	(mpers-m%.stamp): Pass it to $(srcdir)/mpers.sh.
+	* m4/mpers.m4 (st_MPERS): Pass READELF environment variable
+	to $srcdir/mpers_test.sh.
+	* mpers.sh (READELF): New variable.
+	Use it instead of readelf.
+	* maint/ioctls_sym.sh: Likewise.
+	* NEWS: Mention this fix.
+
+	Reported-by: Rolf Eike Beer <eb@emlix.com>
+
+2017-11-22  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: fix llseek test.
+	* tests/llseek.test: Fix typo.
+
+	INSTALL-git.md: fix typo.
+
+	tests: simplify bpf test a bit.
+	* tests/bpf.c (DEF_BPF_INIT_FIRST): New macro.
+	(init_BPF_MAP_CREATE_first, init_BPF_MAP_LOOKUP_ELEM_first,
+	init_BPF_PROG_LOAD_first, init_BPF_OBJ_PIN_first,
+	init_BPF_PROG_ATTACH_first, init_BPF_PROG_TEST_RUN_first,
+	init_BPF_PROG_GET_NEXT_ID_first, init_BPF_OBJ_GET_INFO_BY_FD_first):
+	Use it.
+
+2017-11-21  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Implement decoding of BPF_OBJ_GET_INFO_BY_FD command of bpf syscall.
+	* configure.ac (AC_CHECK_MEMBERS): Add union bpf_attr.info.info.
+	* bpf.c (decode_BPF_OBJ_GET_INFO_BY_FD): New function.
+	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
+	* NEWS: Mention this.
+	* tests/bpf.c: Add macro guard for BPF_OBJ_GET_INFO_BY_FD decoder test.
+	[HAVE_UNION_BPF_ATTR_INFO_INFO] (sample_BPF_OBJ_GET_INFO_BY_FD_attr):
+	New variable.
+	[HAVE_UNION_BPF_ATTR_INFO_INFO] (init_BPF_OBJ_GET_INFO_BY_FD_first,
+	print_BPF_OBJ_GET_INFO_BY_FD_first, init_BPF_OBJ_GET_INFO_BY_FD_attr,
+	print_BPF_OBJ_GET_INFO_BY_FD_attr): New functions.
+	(main) [HAVE_UNION_BPF_ATTR_INFO_INFO]: Use them.
+
+	Simplify union bpf_attr field checks.
+	* configure.ac: Use AC_CHECK_MEMBERS instead of st_CHECK_UNION_BPF_ATTR
+	for union bpf_attr field checks as the former seems to be enough
+	for the case.
+	* m4/st_bpf.m4: Remove.
+
+	Implement decoding of BPF_*_GET_*_ID commands of bpf syscall.
+	* configure.ac: Check for union bpf_attr.next_id.
+	* bpf.c (decode_BPF_PROG_GET_NEXT_ID, decode_BPF_PROG_GET_FD_BY_ID,
+	* decode_BPF_MAP_GET_FD_BY_ID): New functions.
+	(decode_BPF_MAP_GET_NEXT_ID): New macro.
+	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use them.
+	* NEWS: Mention this.
+	* tests/bpf.c: Add macro guard for BPF_*_GET_*_ID decoder tests.
+	[HAVE_UNION_BPF_ATTR_NEXT_ID] (init_BPF_PROG_GET_NEXT_ID_first,
+	print_BPF_PROG_GET_NEXT_ID_first, init_BPF_PROG_GET_NEXT_ID_attr,
+	print_BPF_PROG_GET_NEXT_ID_attr, print_BPF_PROG_GET_FD_BY_ID_first,
+	print_BPF_PROG_GET_FD_BY_ID_attr, print_BPF_MAP_GET_NEXT_ID_first,
+	print_BPF_MAP_GET_NEXT_ID_attr): New functions.
+	(init_BPF_MAP_GET_NEXT_ID_first, print_BPF_MAP_GET_NEXT_ID_first,
+	init_BPF_MAP_GET_NEXT_ID_attr, print_BPF_MAP_GET_NEXT_ID_attr,
+	init_BPF_PROG_GET_FD_BY_ID_first, init_BPF_PROG_GET_FD_BY_ID_attr,
+	init_BPF_MAP_GET_FD_BY_ID_first, init_BPF_MAP_GET_FD_BY_ID_attr):
+	New macros.
+	(main) [HAVE_UNION_BPF_ATTR_NEXT_ID]: Use them.
+
+2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Implement decoding of BPF_PROG_TEST_RUN command of bpf syscall.
+	* configure.ac: Check for union bpf_attr.test.duration.
+	* bpf.c (decode_BPF_PROG_TEST_RUN): New function.
+	(SYS_FUNC(bpf)) <bpf_cmd_decoders>: Use it.
+	* NEWS: Mention this.
+	* tests/bpf.c: Include "print_fields.h".
+	Add macro guard for BPF_PROG_TEST_RUN decoder test.
+	[HAVE_UNION_BPF_ATTR_TEST_DURATION] (sample_BPF_PROG_TEST_RUN_attr):
+	New variable.
+	[HAVE_UNION_BPF_ATTR_TEST_DURATION] (init_BPF_PROG_TEST_RUN_first,
+	print_BPF_PROG_TEST_RUN_first, init_BPF_PROG_TEST_RUN_attr,
+	print_BPF_PROG_TEST_RUN_attr): New functions.
+	(main) [HAVE_UNION_BPF_ATTR_TEST_DURATION]: Use them.
+
+2017-11-20  Dmitry V. Levin  <ldv@altlinux.org>
+
+	bpf: update BPF_MAP_CREATE decoding.
+	Implement decoding of union bpf_attr.numa_node field for BPF_MAP_CREATE
+	command introduced by linux kernel commit v4.14-rc1~130^2~196^2~1.
+
+	* configure.ac: Check for numa_node member of union bpf_attr
+	instead of inner_map_fd.
+	(decode_BPF_MAP_CREATE): Add numa_node field to the structure, print it.
+	* NEWS: Mention this.
+	* tests/bpf.c: Update macro guards of BPF_MAP_CREATE decoder test.
+	(init_BPF_MAP_CREATE_first, print_BPF_MAP_CREATE_attr): Update expected
+	output.
+	(init_BPF_MAP_CREATE_attr): Initialize numa_node field, update offset.
+
+2017-11-20  Eugene Syromiatnikov  <esyr@redhat.com>
+
+	unwind.c: cleanup.
+	* unwind.c (rebuild_cache_if_invalid): Simplify return statement.
+
+	unwind.c: fix typo in comment.
+	* unwind.c (unwind_cache_invalidate, unwind_print_stacktrace,
+	unwind_capture_stacktrace): Replace strack with stack.
+
+2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>
+
+	ipc_shm: decode hugetlb page size in shmget flags.
+	Decode alternative hugetlb page sizes introduced by kernel commit
+	v3.8-rc1~175^2~36.
+
+	* ipc_shm.c [!SHM_HUGE_SHIFT] (SHM_HUGE_SHIFT): New macro.
+	[!SHM_HUGE_MASK] (SHM_HUGE_MASK): Likewise.
+	(SYS_FUNC(shmget)): Print hugetlb page size.
+	* tests/ipc_shm.c: Check it.
+
+2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>
+
+	memfd_create: decode hugetlb page size.
+	Decode alternative hugetlb page sizes introduced by kernel commit
+	v4.14-rc1~126^2~17.
+
+	* configure.ac (AC_CHECK_HEADERS): Add linux/memfd.h.
+	* memfd_create.c [HAVE_LINUX_MEMFD_H]: Include it.
+	[!MFD_HUGE_SHIFT] (MFD_HUGE_SHIFT): New macro.
+	[!MFD_HUGE_MASK] (MFD_HUGE_MASK): Likewise.
+	(SYS_FUNC(memfd_create)): Print hugetlb page size.
+	* tests/memfd_create.c: Check it.
+
+2017-11-18  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Print the first argument of memfd_create syscall as a path.
+	The limit imposed by the kernel on the length of memfd_create first
+	argument is NAME_MAX - strlen("memfd:").
+
+	* memfd_create.c (SYS_FUNC(memfd_create)): Print the first argument
+	using printpathn.
+	* tests/memfd_create.c: Check it.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	mem: decode hugetlb page size in mmap flags.
+	Decode alternative hugetlb page sizes introduced by kernel commit
+	v3.8-rc1~175^2~36.
+
+	* mem.c [!MAP_HUGE_SHIFT] (MAP_HUGE_SHIFT): New macro.
+	[!MAP_HUGE_MASK] (MAP_HUGE_MASK): Likewise.
+	(print_mmap_flags): Print hugetlb page size.
+	* NEWS: Mention it.
+	* tests/remap_file_pages.c: Check it.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	mem: assume that MAP_TYPE is defined.
+	Since linux kernel provided a definition of MAP_TYPE in <asm/mman.h>
+	as long ago as in v2.4.0, it's safe to assume that MAP_TYPE is defined.
+
+	* mem.c (print_mmap_flags) [!MAP_TYPE]: Remove.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	mem: move printing of mmap_flags to a separate function.
+	* mem.c (print_mmap_flags): New function.
+	(print_mmap, SYS_FUNC(remap_file_pages)): Use it.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Provide fallback definitions for SHM_EXEC constant.
+	Although SHM_EXEC is available in <linux/shm.h> since kernel commit
+	v2.6.9-rc2~23^2~93^2~78, the glibc version of <sys/shm.h> did not
+	provide SHM_EXEC until commit glibc-2.10~238.
+
+	* xlat/shm_flags.in (SHM_EXEC): Add fallback definition.
+	* tests/shmxt.c (SHM_EXEC): Likewise.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Update SHM_* constants.
+	* xlat/shm_flags.in: Add SHM_EXEC introduced by kernel commit
+	v2.6.9-rc2~23^2~93^2~78.
+	* xlat/shm_resource_flags.in: Add SHM_NORESERVE introduced by kernel
+	commit v2.6.15-rc1~622.
+	* NEWS: Mention this.
+	* tests/ipc_shm.c (main): Update expected output.
+	* tests/shmxt.c (main): Update expected output, check SHM_EXEC decoding.
+
+2017-11-17  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Remove fallback definitions for SHM_STAT and SHM_INFO constants.
+	These constants are universally available for quite a long time
+	and are used unconditionally in tests without any complaints.
+
+	* xlat/shmctl_flags.in: Remove fallback definitions.
+
+2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	net: fix SOL_NETLINK NETLINK_LIST_MEMBERSHIPS decoding.
+	NETLINK_LIST_MEMBERSHIPS, unlike all other SOL_NETLINK options, requests
+	not just a single integer but an array of integers.  The kernel also
+	supports a zero optlen NETLINK_LIST_MEMBERSHIPS request.
+
+	* net.c (print_uint32): New function.
+	(print_getsockopt): Add ulen argument, rename len argument to rlen,
+	<SOL_NETLINK> Handle NETLINK_LIST_MEMBERSHIPS using print_array
+	and print_uint32.
+	(SYS_FUNC(getsockopt)): Pass ulen to print_getsockopt.
+	* tests/sockopt-sol_netlink.c (main): Check NETLINK_LIST_MEMBERSHIPS
+	decoding.
+
+2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	tests: check [gs]etsockopt SOL_NETLINK decoding.
+	* tests/sockopt-sol_netlink.c: New file.
+	* tests/gen_tests.in (sockopt-sol_netlink): New entry.
+	* tests/pure_executables.list: Add sockopt-sol_netlink.
+	* tests/.gitignore: Likewise.
+
+2017-11-16  Dmitry V. Levin  <ldv@altlinux.org>
+
+	net: fix decoding of optval argument of [gs]etsockopt SOL_NETLINK.
+	Tweak the parser to follow the kernel behaviour.
+
+	* net.c (print_getsockopt, print_setsockopt) <SOL_NETLINK>: Fetch and
+	print returned value as integer iff the length is >= sizeof(int),
+	otherwise print the address.
+	* NEWS: Mention this.
+
+2017-11-15  Dmitry V. Levin  <ldv@altlinux.org>
+
+	net: decode optname argument of [gs]etsockopt for SOL_NETLINK level.
+	* xlat/socknetlinkoptions.in: New file.
+	* net.c: Include "xlat/socknetlinkoptions.h".
+	(print_sockopt_fd_level_name) <SOL_NETLINK>: Print name using
+	socknetlinkoptions.
+	* NEWS: Metnion this.
+
+	Update MSG_* constants.
+	* xlat/msg_flags.in: Add MSG_ZEROCOPY introduced by kernel commit
+	v4.14-rc1~130^2~376^2~6.
+	* NEWS: Mention this.
+
+	netlink: print descriptor attributes using printfd.
+	* nlattr.h (DECL_NLA(fd)): New prototype.
+	* nlattr.c (decode_nla_fd): New function.
+	* rtnl_link.c (ifla_xdp_nla_decoders) <IFLA_XDP_FD>: Use it.
+	(ifinfomsg_nla_decoders) <IFLA_NET_NS_FD>: Likewise.
+	* rtnl_nsid.c (rtgenmsg_nla_decoders) <NETNSA_FD>: Likewise.
+	* NEWS: Mention this.
+
+2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	maint/update_copyright_years.sh: implement concurrent execution.
+	Analogous to the way it is done in xlat/gen.sh.
+
+	* maint/update_copyright_years.sh (MAX_JOBS): New variable, initialize
+	it to double the CPU count.
+	<while [ -n "${1:-}" ]; do case "$1" in>: Add -j option parsing.
+	(jobs, pids): New variables.
+	<git ls-files -- "$@" | grep -vFx "$IGNORED_FILES" | while read f; do>:
+	Execute process_file in background, count background jobs and wait
+	if there are too many.
+
+2017-11-14  Eugene Syromyatnikov  <evgsyr@gmail.com>
+
+	maint/update_copyright_years.sh: use -efu shell mode.
+	* maint/update_copyright_years.sh: Add -efu to shebang.  Adjust
+	the script for -efu shell mode.
+
+2017-11-14  Dmitry V. Levin  <ldv@altlinux.org>
+
+	Post-release administrivia.
+	* NEWS: Add a header line for the next release.
+	* debian/changelog.in: Add a changelog entry for 4.20-1.
+	* strace.spec.in: Likewise.
+
 2017-11-13  Dmitry V. Levin  <ldv@altlinux.org>
 
 	Prepare for 4.20 release.
diff --git a/Makefile.am b/Makefile.am
index 3ea56a1..db9ad6e 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,7 +4,7 @@
 # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
 # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
 # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
-# Copyright (c) 2002-2017 The strace developers.
+# Copyright (c) 2002-2018 The strace developers.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,15 @@
 SUBDIRS = . tests $(TESTS_M32) $(TESTS_MX32)
 
 bin_PROGRAMS = strace
-man_MANS = strace.1
+man_MANS = strace.1 strace-log-merge.1
 bin_SCRIPTS = strace-graph strace-log-merge
 
 OS		= linux
 # ARCH is `i386', `m68k', `sparc', etc.
 ARCH		= @arch@
 
+READELF		= @READELF@
+
 ACLOCAL_AMFLAGS = -I m4
 AM_CFLAGS = $(WARN_CFLAGS)
 AM_CPPFLAGS = -I$(builddir)/$(OS)/$(ARCH) \
@@ -68,8 +70,10 @@
 libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
 libstrace_a_CFLAGS = $(strace_CFLAGS)
 libstrace_a_SOURCES =	\
+	fetch_indirect_syscall_args.c \
 	fstatfs.c \
 	fstatfs64.c \
+	getpagesize.c \
 	ipc.c \
 	sigreturn.c	\
 	socketcall.c \
@@ -86,6 +90,7 @@
 	affinity.c	\
 	aio.c		\
 	alpha.c		\
+	arch_defs.h	\
 	basic_filters.c	\
 	bind.c		\
 	bjm.c		\
@@ -164,6 +169,8 @@
 	kexec.c		\
 	keyctl.c	\
 	keyctl_kdf_params.h \
+	kvm.c		\
+	largefile_wrappers.h \
 	ldt.c		\
 	link.c		\
 	linux/asm_stat.h \
@@ -248,6 +255,7 @@
 	regs.h		\
 	renameat.c	\
 	resource.c	\
+	riscv.c		\
 	rt_sigframe.c	\
 	rt_sigreturn.c	\
 	rtc.c		\
@@ -264,6 +272,7 @@
 	rtnl_rule.c	\
 	rtnl_tc.c	\
 	rtnl_tc_action.c \
+	s390.c		\
 	sched.c		\
 	sched_attr.h	\
 	scsi.c		\
@@ -290,7 +299,6 @@
 	strace.c	\
 	string_to_uint.h \
 	string_to_uint.c \
-	supported_personalities.h \
 	swapon.c	\
 	syscall.c	\
 	sysctl.c	\
@@ -303,6 +311,7 @@
 	term.c		\
 	time.c		\
 	times.c		\
+	trace_event.h	\
 	truncate.c	\
 	ubi.c		\
 	ucopy.c		\
@@ -323,6 +332,7 @@
 	xlat.h		\
 	xmalloc.c	\
 	xmalloc.h	\
+	xstring.h	\
 	# end of strace_SOURCES
 
 if USE_LIBUNWIND
@@ -330,6 +340,11 @@
 strace_CPPFLAGS += $(libunwind_CPPFLAGS)
 strace_LDFLAGS += $(libunwind_LDFLAGS)
 strace_LDADD += $(libunwind_LIBS)
+if USE_DEMANGLE
+strace_CPPFLAGS += $(libiberty_CPPFLAGS)
+strace_LDFLAGS += $(libiberty_LDFLAGS)
+strace_LDADD += $(libiberty_LIBS)
+endif
 endif
 
 @CODE_COVERAGE_RULES@
@@ -376,23 +391,27 @@
 	linux/32/syscallent.h		\
 	linux/64/ioctls_inc.h		\
 	linux/64/syscallent.h		\
+	linux/aarch64/arch_defs_.h	\
 	linux/aarch64/arch_regs.c	\
 	linux/aarch64/arch_regs.h	\
-	linux/aarch64/arch_rt_sigframe.c\
+	linux/aarch64/arch_rt_sigframe.c	\
 	linux/aarch64/arch_sigreturn.c	\
 	linux/aarch64/errnoent1.h	\
 	linux/aarch64/get_error.c	\
 	linux/aarch64/get_scno.c	\
-	linux/aarch64/get_syscall_args.c\
+	linux/aarch64/get_syscall_args.c	\
 	linux/aarch64/ioctls_arch0.h	\
 	linux/aarch64/ioctls_arch1.h	\
 	linux/aarch64/ioctls_inc0.h	\
 	linux/aarch64/ioctls_inc1.h	\
+	linux/aarch64/nr_prefix.c	\
 	linux/aarch64/set_error.c	\
 	linux/aarch64/set_scno.c	\
+	linux/aarch64/shuffle_scno.c	\
 	linux/aarch64/signalent1.h	\
 	linux/aarch64/syscallent.h	\
 	linux/aarch64/syscallent1.h	\
+	linux/alpha/arch_defs_.h	\
 	linux/alpha/arch_getrval2.c	\
 	linux/alpha/arch_regs.c		\
 	linux/alpha/arch_regs.h		\
@@ -402,7 +421,7 @@
 	linux/alpha/get_error.c		\
 	linux/alpha/get_scno.c		\
 	linux/alpha/get_syscall_args.c	\
-	linux/alpha/get_syscall_result.c\
+	linux/alpha/get_syscall_result.c	\
 	linux/alpha/ioctls_arch0.h	\
 	linux/alpha/ioctls_inc0.h	\
 	linux/alpha/set_error.c		\
@@ -421,8 +440,11 @@
 	linux/arc/set_error.c		\
 	linux/arc/set_scno.c		\
 	linux/arc/syscallent.h		\
+	linux/arch_defs_.h		\
+	linux/arch_kvm.c		\
 	linux/arch_regs.h		\
 	linux/arch_sigreturn.c		\
+	linux/arm/arch_defs_.h		\
 	linux/arm/arch_regs.c		\
 	linux/arm/arch_regs.h		\
 	linux/arm/arch_rt_sigframe.c	\
@@ -432,8 +454,10 @@
 	linux/arm/get_syscall_args.c	\
 	linux/arm/ioctls_arch0.h	\
 	linux/arm/ioctls_inc0.h		\
+	linux/arm/nr_prefix.c		\
 	linux/arm/set_error.c		\
 	linux/arm/set_scno.c		\
+	linux/arm/shuffle_scno.c	\
 	linux/arm/syscallent.h		\
 	linux/arm/userent.h		\
 	linux/avr32/arch_regs.c		\
@@ -448,6 +472,7 @@
 	linux/avr32/set_scno.c		\
 	linux/avr32/syscallent.h	\
 	linux/avr32/userent.h		\
+	linux/bfin/arch_defs_.h		\
 	linux/bfin/arch_regs.c		\
 	linux/bfin/arch_rt_sigframe.c	\
 	linux/bfin/get_error.c		\
@@ -461,33 +486,10 @@
 	linux/bfin/set_scno.c		\
 	linux/bfin/syscallent.h		\
 	linux/bfin/userent.h		\
-	linux/crisv10/arch_regs.c	\
-	linux/crisv10/arch_rt_sigframe.c\
-	linux/crisv10/arch_sigreturn.c	\
-	linux/crisv10/get_error.c	\
-	linux/crisv10/get_scno.c	\
-	linux/crisv10/get_syscall_args.c	\
-	linux/crisv10/get_syscall_result.c	\
-	linux/crisv10/rt_sigframe.h	\
-	linux/crisv10/set_error.c	\
-	linux/crisv10/set_scno.c	\
-	linux/crisv10/syscallent.h	\
-	linux/crisv10/userent.h		\
-	linux/crisv32/arch_regs.c	\
-	linux/crisv32/arch_rt_sigframe.c\
-	linux/crisv32/arch_sigreturn.c	\
-	linux/crisv32/get_error.c	\
-	linux/crisv32/get_scno.c	\
-	linux/crisv32/get_syscall_args.c	\
-	linux/crisv32/get_syscall_result.c	\
-	linux/crisv32/rt_sigframe.h	\
-	linux/crisv32/set_error.c	\
-	linux/crisv32/set_scno.c	\
-	linux/crisv32/syscallent.h	\
-	linux/crisv32/userent.h		\
 	linux/dummy.h			\
 	linux/errnoent.h		\
 	linux/getregs_old.h		\
+	linux/hppa/arch_defs_.h		\
 	linux/hppa/arch_regs.c		\
 	linux/hppa/arch_regs.h		\
 	linux/hppa/arch_rt_sigframe.c	\
@@ -503,6 +505,8 @@
 	linux/hppa/set_scno.c		\
 	linux/hppa/signalent.h		\
 	linux/hppa/syscallent.h		\
+	linux/i386/arch_kvm.c		\
+	linux/i386/arch_defs_.h		\
 	linux/i386/arch_regs.c		\
 	linux/i386/arch_regs.h		\
 	linux/i386/arch_rt_sigframe.c	\
@@ -518,6 +522,7 @@
 	linux/i386/syscallent.h		\
 	linux/i386/userent.h		\
 	linux/i386/userent0.h		\
+	linux/ia64/arch_defs_.h		\
 	linux/ia64/arch_getrval2.c	\
 	linux/ia64/arch_regs.c		\
 	linux/ia64/arch_regs.h		\
@@ -533,6 +538,7 @@
 	linux/ia64/syscallent.h		\
 	linux/ia64/userent.h		\
 	linux/inet_diag.h		\
+	linux/m68k/arch_defs_.h		\
 	linux/m68k/arch_regs.c		\
 	linux/m68k/arch_regs.h		\
 	linux/m68k/arch_rt_sigframe.c	\
@@ -558,8 +564,9 @@
 	linux/metag/set_error.c		\
 	linux/metag/set_scno.c		\
 	linux/metag/syscallent.h	\
+	linux/microblaze/arch_defs_.h	\
 	linux/microblaze/arch_regs.c	\
-	linux/microblaze/arch_rt_sigframe.c\
+	linux/microblaze/arch_rt_sigframe.c	\
 	linux/microblaze/arch_sigreturn.c	\
 	linux/microblaze/get_error.c	\
 	linux/microblaze/get_scno.c	\
@@ -571,6 +578,7 @@
 	linux/microblaze/set_scno.c	\
 	linux/microblaze/syscallent.h	\
 	linux/microblaze/userent.h	\
+	linux/mips/arch_defs_.h		\
 	linux/mips/arch_getrval2.c	\
 	linux/mips/arch_regs.c		\
 	linux/mips/arch_regs.h		\
@@ -593,8 +601,8 @@
 	linux/mips/syscallent-o32.h	\
 	linux/mips/syscallent.h		\
 	linux/mips/userent.h		\
-	linux/mtd-abi.h			\
 	linux/netlink_diag.h		\
+	linux/nios2/arch_defs_.h	\
 	linux/nios2/arch_regs.c		\
 	linux/nios2/arch_regs.h		\
 	linux/nios2/arch_rt_sigframe.c	\
@@ -606,6 +614,7 @@
 	linux/nios2/set_error.c		\
 	linux/nios2/set_scno.c		\
 	linux/nios2/syscallent.h	\
+	linux/nr_prefix.c		\
 	linux/or1k/arch_regs.c		\
 	linux/or1k/arch_regs.h		\
 	linux/or1k/arch_rt_sigframe.c	\
@@ -619,10 +628,10 @@
 	linux/or1k/syscallent.h		\
 	linux/or1k/userent.h		\
 	linux/packet_diag.h		\
-	linux/personality.h		\
+	linux/powerpc/arch_defs_.h	\
 	linux/powerpc/arch_regs.c	\
 	linux/powerpc/arch_regs.h	\
-	linux/powerpc/arch_rt_sigframe.c\
+	linux/powerpc/arch_rt_sigframe.c	\
 	linux/powerpc/arch_sigreturn.c	\
 	linux/powerpc/errnoent.h	\
 	linux/powerpc/get_error.c	\
@@ -636,9 +645,10 @@
 	linux/powerpc/set_scno.c	\
 	linux/powerpc/syscallent.h	\
 	linux/powerpc/userent.h		\
+	linux/powerpc64/arch_defs_.h	\
 	linux/powerpc64/arch_regs.c	\
 	linux/powerpc64/arch_regs.h	\
-	linux/powerpc64/arch_rt_sigframe.c\
+	linux/powerpc64/arch_rt_sigframe.c	\
 	linux/powerpc64/arch_sigreturn.c	\
 	linux/powerpc64/errnoent.h	\
 	linux/powerpc64/errnoent1.h	\
@@ -658,7 +668,7 @@
 	linux/powerpc64/syscallent.h	\
 	linux/powerpc64/syscallent1.h	\
 	linux/powerpc64/userent.h	\
-	linux/ptp_clock.h		\
+	linux/riscv/arch_defs_.h	\
 	linux/riscv/arch_regs.c		\
 	linux/riscv/arch_regs.h		\
 	linux/riscv/arch_rt_sigframe.c	\
@@ -676,6 +686,7 @@
 	linux/riscv/syscallent.h	\
 	linux/riscv/syscallent1.h	\
 	linux/rt_sigframe.h		\
+	linux/s390/arch_defs_.h		\
 	linux/s390/arch_regs.c		\
 	linux/s390/arch_regs.h		\
 	linux/s390/arch_rt_sigframe.c	\
@@ -692,20 +703,27 @@
 	linux/s390/userent.h		\
 	linux/s390/userent0.h		\
 	linux/s390/userent1.h		\
+	linux/s390x/arch_defs_.h	\
 	linux/s390x/arch_regs.c		\
 	linux/s390x/arch_regs.h		\
 	linux/s390x/arch_rt_sigframe.c	\
 	linux/s390x/arch_sigreturn.c	\
+	linux/s390x/errnoent1.h		\
 	linux/s390x/get_error.c		\
 	linux/s390x/get_scno.c		\
 	linux/s390x/get_syscall_args.c	\
 	linux/s390x/ioctls_arch0.h	\
+	linux/s390x/ioctls_arch1.h	\
 	linux/s390x/ioctls_inc0.h	\
+	linux/s390x/ioctls_inc1.h	\
 	linux/s390x/rt_sigframe.h	\
 	linux/s390x/set_error.c		\
 	linux/s390x/set_scno.c		\
+	linux/s390x/signalent1.h	\
 	linux/s390x/syscallent.h	\
+	linux/s390x/syscallent1.h	\
 	linux/s390x/userent.h		\
+	linux/sh/arch_defs_.h		\
 	linux/sh/arch_getrval2.c	\
 	linux/sh/arch_regs.c		\
 	linux/sh/arch_rt_sigframe.c	\
@@ -720,6 +738,7 @@
 	linux/sh/syscallent.h		\
 	linux/sh/userent.h		\
 	linux/sh/userent0.h		\
+	linux/sh64/arch_defs_.h		\
 	linux/sh64/arch_regs.c		\
 	linux/sh64/arch_regs.h		\
 	linux/sh64/arch_rt_sigframe.c	\
@@ -734,16 +753,17 @@
 	linux/sh64/set_scno.c		\
 	linux/sh64/syscallent.h		\
 	linux/sh64/userent.h		\
+	linux/shuffle_scno.c		\
 	linux/signalent.h		\
 	linux/smc_diag.h		\
 	linux/sock_diag.h		\
+	linux/sparc/arch_defs_.h	\
 	linux/sparc/arch_getrval2.c	\
 	linux/sparc/arch_regs.c		\
 	linux/sparc/arch_regs.h		\
 	linux/sparc/arch_rt_sigframe.c	\
 	linux/sparc/arch_sigreturn.c	\
 	linux/sparc/errnoent.h		\
-	linux/sparc/gen.pl		\
 	linux/sparc/get_error.c		\
 	linux/sparc/get_scno.c		\
 	linux/sparc/get_syscall_args.c	\
@@ -755,16 +775,17 @@
 	linux/sparc/signalent.h		\
 	linux/sparc/syscallent.h	\
 	linux/sparc/userent.h		\
+	linux/sparc64/arch_defs_.h	\
 	linux/sparc64/arch_getrval2.c	\
 	linux/sparc64/arch_regs.c	\
 	linux/sparc64/arch_regs.h	\
-	linux/sparc64/arch_rt_sigframe.c\
+	linux/sparc64/arch_rt_sigframe.c	\
 	linux/sparc64/arch_sigreturn.c	\
 	linux/sparc64/errnoent.h	\
 	linux/sparc64/errnoent1.h	\
 	linux/sparc64/get_error.c	\
 	linux/sparc64/get_scno.c	\
-	linux/sparc64/get_syscall_args.c\
+	linux/sparc64/get_syscall_args.c	\
 	linux/sparc64/ioctls_arch0.h	\
 	linux/sparc64/ioctls_arch1.h	\
 	linux/sparc64/ioctls_inc0.h	\
@@ -779,6 +800,7 @@
 	linux/sparc64/userent.h		\
 	linux/subcall.h			\
 	linux/syscall.h			\
+	linux/tile/arch_defs_.h		\
 	linux/tile/arch_regs.c		\
 	linux/tile/arch_regs.h		\
 	linux/tile/arch_rt_sigframe.c	\
@@ -798,10 +820,11 @@
 	linux/tile/syscallent.h		\
 	linux/tile/syscallent1.h	\
 	linux/tile/userent.h		\
-	linux/ubi-user.h		\
 	linux/unix_diag.h		\
 	linux/userent.h			\
 	linux/userent0.h		\
+	linux/x32/arch_defs_.h		\
+	linux/x32/arch_kvm.c		\
 	linux/x32/arch_regs.c		\
 	linux/x32/arch_regs.h		\
 	linux/x32/arch_rt_sigframe.c	\
@@ -817,17 +840,19 @@
 	linux/x32/rt_sigframe.h		\
 	linux/x32/set_error.c		\
 	linux/x32/set_scno.c		\
+	linux/x32/shuffle_scno.c	\
 	linux/x32/signalent1.h		\
 	linux/x32/syscallent.h		\
 	linux/x32/syscallent1.h		\
 	linux/x32/userent.h		\
+	linux/x86_64/arch_defs_.h	\
+	linux/x86_64/arch_kvm.c		\
 	linux/x86_64/arch_regs.c	\
 	linux/x86_64/arch_regs.h	\
 	linux/x86_64/arch_rt_sigframe.c	\
 	linux/x86_64/arch_sigreturn.c	\
 	linux/x86_64/errnoent1.h	\
 	linux/x86_64/errnoent2.h	\
-	linux/x86_64/gentab.pl		\
 	linux/x86_64/get_error.c	\
 	linux/x86_64/get_scno.c		\
 	linux/x86_64/get_syscall_args.c	\
@@ -842,6 +867,7 @@
 	linux/x86_64/rt_sigframe.h	\
 	linux/x86_64/set_error.c	\
 	linux/x86_64/set_scno.c		\
+	linux/x86_64/shuffle_scno.c	\
 	linux/x86_64/signalent1.h	\
 	linux/x86_64/signalent2.h	\
 	linux/x86_64/syscallent.h	\
@@ -871,7 +897,7 @@
 	$(XLAT_INPUT_FILES)		\
 	$(XLAT_HEADER_FILES)		\
 	xlat/gen.sh			\
-	xlate.el
+	# end of EXTRA_DIST
 
 .PHONY: check-valgrind-local
 check-valgrind-local:
@@ -987,9 +1013,12 @@
 
 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
 	for f in $^; do \
-		CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
-		CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
-		$(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
+		READELF="$(READELF)" \
+		CC="$(CC)" \
+		CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
+		CPP="$(CPP)" \
+		CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
+		$(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \
 	done
 	> $@
 
@@ -1060,6 +1089,7 @@
 CLEANFILES    += $(mpers_m32_targets)
 
 $(mpers_m32_targets): mpers_NAME = m32
+$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@
 
 endif # HAVE_M32_MPERS
 
@@ -1076,6 +1106,7 @@
 CLEANFILES    += $(mpers_mx32_targets)
 
 $(mpers_mx32_targets): mpers_NAME = mx32
+$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@
 
 endif # HAVE_MX32_MPERS
 
diff --git a/Makefile.in b/Makefile.in
index 2f14f43..f1822ad 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -20,7 +20,7 @@
 # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
 # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
 # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
-# Copyright (c) 2002-2017 The strace developers.
+# Copyright (c) 2002-2018 The strace developers.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -143,27 +143,31 @@
 	$(srcdir)/mpers.am $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
 	$(top_srcdir)/configure $(am__configure_deps) \
 	$(srcdir)/config.h.in $(srcdir)/strace.1.in \
-	$(srcdir)/strace.spec.in $(top_srcdir)/debian/changelog.in \
-	depcomp AUTHORS COPYING INSTALL NEWS README compile \
-	config.guess config.sub install-sh missing
+	$(srcdir)/strace-log-merge.1.in $(srcdir)/strace.spec.in \
+	$(top_srcdir)/debian/changelog.in depcomp AUTHORS COPYING \
+	INSTALL NEWS README compile config.guess config.sub install-sh \
+	missing
 @USE_LIBUNWIND_TRUE@am__append_1 = unwind.c
 @USE_LIBUNWIND_TRUE@am__append_2 = $(libunwind_CPPFLAGS)
 @USE_LIBUNWIND_TRUE@am__append_3 = $(libunwind_LDFLAGS)
 @USE_LIBUNWIND_TRUE@am__append_4 = $(libunwind_LIBS)
-@HAVE_M32_MPERS_TRUE@am__append_5 = libmpers-m32.a
-@HAVE_M32_MPERS_TRUE@am__append_6 = libmpers-m32.a
-@HAVE_M32_MPERS_TRUE@am__append_7 = $(mpers_m32_targets)
-@HAVE_M32_MPERS_TRUE@am__append_8 = $(mpers_m32_targets)
-@HAVE_MX32_MPERS_TRUE@am__append_9 = libmpers-mx32.a
-@HAVE_MX32_MPERS_TRUE@am__append_10 = libmpers-mx32.a
-@HAVE_MX32_MPERS_TRUE@am__append_11 = $(mpers_mx32_targets)
-@HAVE_MX32_MPERS_TRUE@am__append_12 = $(mpers_mx32_targets)
+@USE_DEMANGLE_TRUE@@USE_LIBUNWIND_TRUE@am__append_5 = $(libiberty_CPPFLAGS)
+@USE_DEMANGLE_TRUE@@USE_LIBUNWIND_TRUE@am__append_6 = $(libiberty_LDFLAGS)
+@USE_DEMANGLE_TRUE@@USE_LIBUNWIND_TRUE@am__append_7 = $(libiberty_LIBS)
+@HAVE_M32_MPERS_TRUE@am__append_8 = libmpers-m32.a
+@HAVE_M32_MPERS_TRUE@am__append_9 = libmpers-m32.a
+@HAVE_M32_MPERS_TRUE@am__append_10 = $(mpers_m32_targets)
+@HAVE_M32_MPERS_TRUE@am__append_11 = $(mpers_m32_targets)
+@HAVE_MX32_MPERS_TRUE@am__append_12 = libmpers-mx32.a
+@HAVE_MX32_MPERS_TRUE@am__append_13 = libmpers-mx32.a
+@HAVE_MX32_MPERS_TRUE@am__append_14 = $(mpers_mx32_targets)
+@HAVE_MX32_MPERS_TRUE@am__append_15 = $(mpers_mx32_targets)
 subdir = .
 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
 am__aclocal_m4_deps = $(top_srcdir)/m4/ax_code_coverage.m4 \
 	$(top_srcdir)/m4/ax_prog_cc_for_build.m4 \
 	$(top_srcdir)/m4/ax_valgrind_check.m4 \
-	$(top_srcdir)/m4/mpers.m4 $(top_srcdir)/m4/st_bpf.m4 \
+	$(top_srcdir)/m4/mpers.m4 \
 	$(top_srcdir)/m4/st_save_restore_var.m4 \
 	$(top_srcdir)/m4/st_warn_cflags.m4 \
 	$(top_srcdir)/m4/warnings.m4 $(top_srcdir)/configure.ac
@@ -173,7 +177,8 @@
  configure.lineno config.status.lineno
 mkinstalldirs = $(install_sh) -d
 CONFIG_HEADER = config.h
-CONFIG_CLEAN_FILES = strace.1 strace.spec debian/changelog
+CONFIG_CLEAN_FILES = strace.1 strace-log-merge.1 strace.spec \
+	debian/changelog
 CONFIG_CLEAN_VPATH_FILES =
 LIBRARIES = $(noinst_LIBRARIES)
 AR = ar
@@ -282,8 +287,10 @@
 libmpers_mx32_a_OBJECTS = $(am_libmpers_mx32_a_OBJECTS)
 libstrace_a_AR = $(AR) $(ARFLAGS)
 libstrace_a_LIBADD =
-am_libstrace_a_OBJECTS = libstrace_a-fstatfs.$(OBJEXT) \
-	libstrace_a-fstatfs64.$(OBJEXT) libstrace_a-ipc.$(OBJEXT) \
+am_libstrace_a_OBJECTS =  \
+	libstrace_a-fetch_indirect_syscall_args.$(OBJEXT) \
+	libstrace_a-fstatfs.$(OBJEXT) libstrace_a-fstatfs64.$(OBJEXT) \
+	libstrace_a-getpagesize.$(OBJEXT) libstrace_a-ipc.$(OBJEXT) \
 	libstrace_a-sigreturn.$(OBJEXT) \
 	libstrace_a-socketcall.$(OBJEXT) libstrace_a-statfs.$(OBJEXT) \
 	libstrace_a-statfs64.$(OBJEXT) \
@@ -295,8 +302,8 @@
 	"$(DESTDIR)$(man1dir)"
 PROGRAMS = $(bin_PROGRAMS)
 am__strace_SOURCES_DIST = access.c affinity.c aio.c alpha.c \
-	basic_filters.c bind.c bjm.c block.c bpf.c bpf_filter.c \
-	bpf_filter.h bpf_fprog.h bpf_seccomp_filter.c \
+	arch_defs.h basic_filters.c bind.c bjm.c block.c bpf.c \
+	bpf_filter.c bpf_filter.h bpf_fprog.h bpf_seccomp_filter.c \
 	bpf_sock_filter.c btrfs.c cacheflush.c capability.c caps0.h \
 	caps1.h chdir.c chmod.c clone.c copy_file_range.c count.c \
 	defs.h desc.c dirent.c dirent64.c dm.c dyxlat.c empty.h \
@@ -311,40 +318,41 @@
 	getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c ioctl.c \
 	ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c ipc_msgctl.c \
 	ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c kernel_types.h kexec.c \
-	keyctl.c keyctl_kdf_params.h ldt.c link.c linux/asm_stat.h \
-	linux/x32/asm_stat.h linux/x86_64/asm_stat.h listen.c \
-	lookup_dcookie.c loop.c lseek.c macros.h mem.c membarrier.c \
-	memfd_create.c mknod.c mmsghdr.c mount.c mpers_type.h mq.c \
-	msghdr.c msghdr.h mtd.c native_defs.h negated_errno.h net.c \
-	netlink.c netlink.h netlink_crypto.c netlink_sock_diag.h \
-	netlink_inet_diag.c netlink_netlink_diag.c \
-	netlink_packet_diag.c netlink_route.c netlink_route.h \
-	netlink_selinux.c netlink_smc_diag.c netlink_sock_diag.c \
-	netlink_unix_diag.c nlattr.c nlattr.h nsfs.c nsfs.h nsig.h \
-	numa.c number_set.c number_set.h oldstat.c open.c \
-	or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \
-	personality.c pkeys.c poll.c prctl.c print_dev_t.c \
-	print_group_req.c print_fields.h print_ifindex.c \
+	keyctl.c keyctl_kdf_params.h kvm.c largefile_wrappers.h ldt.c \
+	link.c linux/asm_stat.h linux/x32/asm_stat.h \
+	linux/x86_64/asm_stat.h listen.c lookup_dcookie.c loop.c \
+	lseek.c macros.h mem.c membarrier.c memfd_create.c mknod.c \
+	mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \
+	native_defs.h negated_errno.h net.c netlink.c netlink.h \
+	netlink_crypto.c netlink_sock_diag.h netlink_inet_diag.c \
+	netlink_netlink_diag.c netlink_packet_diag.c netlink_route.c \
+	netlink_route.h netlink_selinux.c netlink_smc_diag.c \
+	netlink_sock_diag.c netlink_unix_diag.c nlattr.c nlattr.h \
+	nsfs.c nsfs.h nsig.h numa.c number_set.c number_set.h \
+	oldstat.c open.c or1k_atomic.c pathtrace.c perf.c \
+	perf_event_struct.h personality.c pkeys.c poll.c prctl.c \
+	print_dev_t.c print_group_req.c print_fields.h print_ifindex.c \
 	print_mq_attr.c print_msgbuf.c print_sg_req_info.c \
 	print_sigevent.c print_statfs.c print_struct_stat.c \
 	print_time.c print_timespec.c print_timeval.c print_timex.c \
 	printmode.c printrusage.c printsiginfo.c printsiginfo.h \
 	process.c process_vm.c ptp.c ptrace.h quota.c readahead.c \
-	readlink.c reboot.c regs.h renameat.c resource.c rt_sigframe.c \
-	rt_sigreturn.c rtc.c rtnl_addr.c rtnl_addrlabel.c rtnl_dcb.c \
-	rtnl_link.c rtnl_mdb.c rtnl_neigh.c rtnl_neightbl.c \
-	rtnl_netconf.c rtnl_nsid.c rtnl_route.c rtnl_rule.c rtnl_tc.c \
-	rtnl_tc_action.c sched.c sched_attr.h scsi.c seccomp.c \
-	sendfile.c sg_io_v3.c sg_io_v4.c shutdown.c sigaltstack.c \
-	sigevent.h signal.c signalfd.c sock.c sockaddr.c socketutils.c \
-	sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h statx.c \
-	statx.h strace.c string_to_uint.h string_to_uint.c \
-	supported_personalities.h swapon.c syscall.c sysctl.c sysent.h \
-	sysent_shorthand_defs.h sysent_shorthand_undefs.h sysinfo.c \
-	syslog.c sysmips.c term.c time.c times.c truncate.c ubi.c \
-	ucopy.c uid.c uid16.c umask.c umount.c uname.c userfaultfd.c \
-	ustat.c util.c utime.c utimes.c v4l2.c wait.c xattr.c xlat.c \
-	xlat.h xmalloc.c xmalloc.h unwind.c
+	readlink.c reboot.c regs.h renameat.c resource.c riscv.c \
+	rt_sigframe.c rt_sigreturn.c rtc.c rtnl_addr.c \
+	rtnl_addrlabel.c rtnl_dcb.c rtnl_link.c rtnl_mdb.c \
+	rtnl_neigh.c rtnl_neightbl.c rtnl_netconf.c rtnl_nsid.c \
+	rtnl_route.c rtnl_rule.c rtnl_tc.c rtnl_tc_action.c s390.c \
+	sched.c sched_attr.h scsi.c seccomp.c sendfile.c sg_io_v3.c \
+	sg_io_v4.c shutdown.c sigaltstack.c sigevent.h signal.c \
+	signalfd.c sock.c sockaddr.c socketutils.c sram_alloc.c stat.c \
+	stat.h stat64.c statfs.c statfs.h statx.c statx.h strace.c \
+	string_to_uint.h string_to_uint.c swapon.c syscall.c sysctl.c \
+	sysent.h sysent_shorthand_defs.h sysent_shorthand_undefs.h \
+	sysinfo.c syslog.c sysmips.c term.c time.c times.c \
+	trace_event.h truncate.c ubi.c ucopy.c uid.c uid16.c umask.c \
+	umount.c uname.c userfaultfd.c ustat.c util.c utime.c utimes.c \
+	v4l2.c wait.c xattr.c xlat.c xlat.h xmalloc.c xmalloc.h \
+	xstring.h unwind.c
 @USE_LIBUNWIND_TRUE@am__objects_3 = strace-unwind.$(OBJEXT)
 am_strace_OBJECTS = strace-access.$(OBJEXT) strace-affinity.$(OBJEXT) \
 	strace-aio.$(OBJEXT) strace-alpha.$(OBJEXT) \
@@ -385,15 +393,16 @@
 	strace-ipc_sem.$(OBJEXT) strace-ipc_shm.$(OBJEXT) \
 	strace-ipc_shmctl.$(OBJEXT) strace-kcmp.$(OBJEXT) \
 	strace-kexec.$(OBJEXT) strace-keyctl.$(OBJEXT) \
-	strace-ldt.$(OBJEXT) strace-link.$(OBJEXT) \
-	strace-listen.$(OBJEXT) strace-lookup_dcookie.$(OBJEXT) \
-	strace-loop.$(OBJEXT) strace-lseek.$(OBJEXT) \
-	strace-mem.$(OBJEXT) strace-membarrier.$(OBJEXT) \
-	strace-memfd_create.$(OBJEXT) strace-mknod.$(OBJEXT) \
-	strace-mmsghdr.$(OBJEXT) strace-mount.$(OBJEXT) \
-	strace-mq.$(OBJEXT) strace-msghdr.$(OBJEXT) \
-	strace-mtd.$(OBJEXT) strace-net.$(OBJEXT) \
-	strace-netlink.$(OBJEXT) strace-netlink_crypto.$(OBJEXT) \
+	strace-kvm.$(OBJEXT) strace-ldt.$(OBJEXT) \
+	strace-link.$(OBJEXT) strace-listen.$(OBJEXT) \
+	strace-lookup_dcookie.$(OBJEXT) strace-loop.$(OBJEXT) \
+	strace-lseek.$(OBJEXT) strace-mem.$(OBJEXT) \
+	strace-membarrier.$(OBJEXT) strace-memfd_create.$(OBJEXT) \
+	strace-mknod.$(OBJEXT) strace-mmsghdr.$(OBJEXT) \
+	strace-mount.$(OBJEXT) strace-mq.$(OBJEXT) \
+	strace-msghdr.$(OBJEXT) strace-mtd.$(OBJEXT) \
+	strace-net.$(OBJEXT) strace-netlink.$(OBJEXT) \
+	strace-netlink_crypto.$(OBJEXT) \
 	strace-netlink_inet_diag.$(OBJEXT) \
 	strace-netlink_netlink_diag.$(OBJEXT) \
 	strace-netlink_packet_diag.$(OBJEXT) \
@@ -421,15 +430,16 @@
 	strace-ptp.$(OBJEXT) strace-quota.$(OBJEXT) \
 	strace-readahead.$(OBJEXT) strace-readlink.$(OBJEXT) \
 	strace-reboot.$(OBJEXT) strace-renameat.$(OBJEXT) \
-	strace-resource.$(OBJEXT) strace-rt_sigframe.$(OBJEXT) \
-	strace-rt_sigreturn.$(OBJEXT) strace-rtc.$(OBJEXT) \
-	strace-rtnl_addr.$(OBJEXT) strace-rtnl_addrlabel.$(OBJEXT) \
-	strace-rtnl_dcb.$(OBJEXT) strace-rtnl_link.$(OBJEXT) \
-	strace-rtnl_mdb.$(OBJEXT) strace-rtnl_neigh.$(OBJEXT) \
-	strace-rtnl_neightbl.$(OBJEXT) strace-rtnl_netconf.$(OBJEXT) \
-	strace-rtnl_nsid.$(OBJEXT) strace-rtnl_route.$(OBJEXT) \
-	strace-rtnl_rule.$(OBJEXT) strace-rtnl_tc.$(OBJEXT) \
-	strace-rtnl_tc_action.$(OBJEXT) strace-sched.$(OBJEXT) \
+	strace-resource.$(OBJEXT) strace-riscv.$(OBJEXT) \
+	strace-rt_sigframe.$(OBJEXT) strace-rt_sigreturn.$(OBJEXT) \
+	strace-rtc.$(OBJEXT) strace-rtnl_addr.$(OBJEXT) \
+	strace-rtnl_addrlabel.$(OBJEXT) strace-rtnl_dcb.$(OBJEXT) \
+	strace-rtnl_link.$(OBJEXT) strace-rtnl_mdb.$(OBJEXT) \
+	strace-rtnl_neigh.$(OBJEXT) strace-rtnl_neightbl.$(OBJEXT) \
+	strace-rtnl_netconf.$(OBJEXT) strace-rtnl_nsid.$(OBJEXT) \
+	strace-rtnl_route.$(OBJEXT) strace-rtnl_rule.$(OBJEXT) \
+	strace-rtnl_tc.$(OBJEXT) strace-rtnl_tc_action.$(OBJEXT) \
+	strace-s390.$(OBJEXT) strace-sched.$(OBJEXT) \
 	strace-scsi.$(OBJEXT) strace-seccomp.$(OBJEXT) \
 	strace-sendfile.$(OBJEXT) strace-sg_io_v3.$(OBJEXT) \
 	strace-sg_io_v4.$(OBJEXT) strace-shutdown.$(OBJEXT) \
@@ -457,8 +467,11 @@
 strace_OBJECTS = $(am_strace_OBJECTS)
 am__DEPENDENCIES_1 =
 @USE_LIBUNWIND_TRUE@am__DEPENDENCIES_2 = $(am__DEPENDENCIES_1)
+@USE_DEMANGLE_TRUE@@USE_LIBUNWIND_TRUE@am__DEPENDENCIES_3 =  \
+@USE_DEMANGLE_TRUE@@USE_LIBUNWIND_TRUE@	$(am__DEPENDENCIES_1)
 strace_DEPENDENCIES = libstrace.a $(am__DEPENDENCIES_2) \
-	$(am__DEPENDENCIES_1) $(am__append_5) $(am__append_9)
+	$(am__DEPENDENCIES_3) $(am__DEPENDENCIES_1) $(am__append_8) \
+	$(am__append_12)
 strace_LINK = $(CCLD) $(strace_CFLAGS) $(CFLAGS) $(strace_LDFLAGS) \
 	$(LDFLAGS) -o $@
 am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
@@ -686,10 +699,13 @@
 PATH_SEPARATOR = @PATH_SEPARATOR@
 PERL = @PERL@
 RANLIB = @RANLIB@
+READELF = @READELF@
 RPM_CHANGELOGTIME = @RPM_CHANGELOGTIME@
 SED = @SED@
 SET_MAKE = @SET_MAKE@
 SHELL = @SHELL@
+SIZEOF_KERNEL_LONG_T = @SIZEOF_KERNEL_LONG_T@
+SIZEOF_LONG = @SIZEOF_LONG@
 STRIP = @STRIP@
 VALGRIND = @VALGRIND@
 VALGRIND_ENABLED = @VALGRIND_ENABLED@
@@ -710,6 +726,7 @@
 arch = @arch@
 arch_m32 = @arch_m32@
 arch_mx32 = @arch_mx32@
+arch_native = @arch_native@
 bindir = @bindir@
 build = @build@
 build_alias = @build_alias@
@@ -717,6 +734,8 @@
 build_os = @build_os@
 build_vendor = @build_vendor@
 builddir = @builddir@
+cc_flags_m32 = @cc_flags_m32@
+cc_flags_mx32 = @cc_flags_mx32@
 datadir = @datadir@
 datarootdir = @datarootdir@
 dl_LIBS = @dl_LIBS@
@@ -734,6 +753,9 @@
 install_sh = @install_sh@
 libdir = @libdir@
 libexecdir = @libexecdir@
+libiberty_CPPFLAGS = @libiberty_CPPFLAGS@
+libiberty_LDFLAGS = @libiberty_LDFLAGS@
+libiberty_LIBS = @libiberty_LIBS@
 libunwind_CPPFLAGS = @libunwind_CPPFLAGS@
 libunwind_LDFLAGS = @libunwind_LDFLAGS@
 libunwind_LIBS = @libunwind_LIBS@
@@ -759,7 +781,7 @@
 @HAVE_M32_RUNTIME_TRUE@TESTS_M32 = tests-m32
 @HAVE_MX32_RUNTIME_TRUE@TESTS_MX32 = tests-mx32
 SUBDIRS = . tests $(TESTS_M32) $(TESTS_MX32)
-man_MANS = strace.1
+man_MANS = strace.1 strace-log-merge.1
 bin_SCRIPTS = strace-graph strace-log-merge
 OS = linux
 # ARCH is `i386', `m68k', `sparc', etc.
@@ -841,7 +863,8 @@
 	xlat/kcmp_types.in xlat/kexec_arch_values.in \
 	xlat/kexec_file_load_flags.in xlat/kexec_load_flags.in \
 	xlat/key_perms.in xlat/key_reqkeys.in xlat/key_spec.in \
-	xlat/keyctl_commands.in xlat/lockfcmds.in xlat/loop_cmds.in \
+	xlat/keyctl_commands.in xlat/kvm_mem_flags.in \
+	xlat/lockfcmds.in xlat/loop_cmds.in \
 	xlat/loop_crypt_type_options.in xlat/loop_flags_options.in \
 	xlat/lwtunnel_encap_types.in xlat/madvise_cmds.in \
 	xlat/mbindflags.in xlat/mctl_sync.in xlat/mdb_flags.in \
@@ -894,15 +917,16 @@
 	xlat/ptrace_setoptions_flags.in xlat/quota_formats.in \
 	xlat/quotacmds.in xlat/quotatypes.in xlat/rename_flags.in \
 	xlat/resource_flags.in xlat/resources.in \
-	xlat/route_nexthop_flags.in xlat/routing_flags.in \
-	xlat/routing_protocols.in xlat/routing_scopes.in \
-	xlat/routing_table_ids.in xlat/routing_types.in \
-	xlat/rtnl_addr_attrs.in xlat/rtnl_addrlabel_attrs.in \
-	xlat/rtnl_dcb_attrs.in xlat/rtnl_ifla_brport_attrs.in \
-	xlat/rtnl_ifla_info_attrs.in xlat/rtnl_ifla_port_attrs.in \
-	xlat/rtnl_ifla_vf_port_attrs.in xlat/rtnl_ifla_xdp_attrs.in \
-	xlat/rtnl_link_attrs.in xlat/rtnl_mdb_attrs.in \
-	xlat/rtnl_mdba_mdb_attrs.in xlat/rtnl_mdba_mdb_eattr_attrs.in \
+	xlat/riscv_flush_icache_flags.in xlat/route_nexthop_flags.in \
+	xlat/routing_flags.in xlat/routing_protocols.in \
+	xlat/routing_scopes.in xlat/routing_table_ids.in \
+	xlat/routing_types.in xlat/rtnl_addr_attrs.in \
+	xlat/rtnl_addrlabel_attrs.in xlat/rtnl_dcb_attrs.in \
+	xlat/rtnl_ifla_brport_attrs.in xlat/rtnl_ifla_info_attrs.in \
+	xlat/rtnl_ifla_port_attrs.in xlat/rtnl_ifla_vf_port_attrs.in \
+	xlat/rtnl_ifla_xdp_attrs.in xlat/rtnl_link_attrs.in \
+	xlat/rtnl_mdb_attrs.in xlat/rtnl_mdba_mdb_attrs.in \
+	xlat/rtnl_mdba_mdb_eattr_attrs.in \
 	xlat/rtnl_mdba_mdb_entry_attrs.in \
 	xlat/rtnl_mdba_router_attrs.in \
 	xlat/rtnl_mdba_router_pattr_attrs.in xlat/rtnl_neigh_attrs.in \
@@ -912,12 +936,14 @@
 	xlat/rtnl_rule_attrs.in xlat/rtnl_tc_action_attrs.in \
 	xlat/rtnl_tc_attrs.in xlat/rtnl_tca_stab_attrs.in \
 	xlat/rtnl_tca_stats_attrs.in xlat/rwf_flags.in \
-	xlat/sa_handler_values.in xlat/sched_flags.in \
-	xlat/schedulers.in xlat/scmvals.in xlat/scsi_sg_commands.in \
-	xlat/secbits.in xlat/seccomp_filter_flags.in \
-	xlat/seccomp_mode.in xlat/seccomp_ops.in \
-	xlat/seccomp_ret_action.in xlat/semctl_flags.in \
-	xlat/semop_flags.in xlat/setns_types.in \
+	xlat/s390_guarded_storage_commands.in \
+	xlat/s390_runtime_instr_commands.in \
+	xlat/s390_sthyi_function_codes.in xlat/sa_handler_values.in \
+	xlat/sched_flags.in xlat/schedulers.in xlat/scmvals.in \
+	xlat/scsi_sg_commands.in xlat/secbits.in \
+	xlat/seccomp_filter_flags.in xlat/seccomp_mode.in \
+	xlat/seccomp_ops.in xlat/seccomp_ret_action.in \
+	xlat/semctl_flags.in xlat/semop_flags.in xlat/setns_types.in \
 	xlat/setsockipoptions.in xlat/setsockipv6options.in \
 	xlat/sfd_flags.in xlat/sg_io_dxfer_direction.in \
 	xlat/sg_io_flags.in xlat/sg_io_info.in xlat/sg_scsi_reset.in \
@@ -935,9 +961,10 @@
 	xlat/sock_type_flags.in xlat/socketcalls.in \
 	xlat/socketlayers.in xlat/sockipoptions.in \
 	xlat/sockipv6options.in xlat/sockipxoptions.in \
-	xlat/sockoptions.in xlat/sockpacketoptions.in \
-	xlat/sockrawoptions.in xlat/socksctpoptions.in \
-	xlat/socktcpoptions.in xlat/socktypes.in xlat/splice_flags.in \
+	xlat/socknetlinkoptions.in xlat/sockoptions.in \
+	xlat/sockpacketoptions.in xlat/sockrawoptions.in \
+	xlat/socksctpoptions.in xlat/socktcpoptions.in \
+	xlat/socktypes.in xlat/splice_flags.in \
 	xlat/sram_alloc_flags.in xlat/statfs_flags.in \
 	xlat/statx_attrs.in xlat/statx_masks.in xlat/swap_flags.in \
 	xlat/sync_file_range_flags.in xlat/sysctl_kern.in \
@@ -1032,11 +1059,11 @@
 	xlat/kcmp_types.h xlat/kexec_arch_values.h \
 	xlat/kexec_file_load_flags.h xlat/kexec_load_flags.h \
 	xlat/key_perms.h xlat/key_reqkeys.h xlat/key_spec.h \
-	xlat/keyctl_commands.h xlat/lockfcmds.h xlat/loop_cmds.h \
-	xlat/loop_crypt_type_options.h xlat/loop_flags_options.h \
-	xlat/lwtunnel_encap_types.h xlat/madvise_cmds.h \
-	xlat/mbindflags.h xlat/mctl_sync.h xlat/mdb_flags.h \
-	xlat/mdb_states.h xlat/membarrier_cmds.h \
+	xlat/keyctl_commands.h xlat/kvm_mem_flags.h xlat/lockfcmds.h \
+	xlat/loop_cmds.h xlat/loop_crypt_type_options.h \
+	xlat/loop_flags_options.h xlat/lwtunnel_encap_types.h \
+	xlat/madvise_cmds.h xlat/mbindflags.h xlat/mctl_sync.h \
+	xlat/mdb_flags.h xlat/mdb_states.h xlat/membarrier_cmds.h \
 	xlat/memfd_create_flags.h xlat/mempolicyflags.h \
 	xlat/mlock_flags.h xlat/mlockall_flags.h xlat/mmap_flags.h \
 	xlat/mmap_prot.h xlat/modem_flags.h xlat/modetypes.h \
@@ -1084,15 +1111,16 @@
 	xlat/ptrace_setoptions_flags.h xlat/quota_formats.h \
 	xlat/quotacmds.h xlat/quotatypes.h xlat/rename_flags.h \
 	xlat/resource_flags.h xlat/resources.h \
-	xlat/route_nexthop_flags.h xlat/routing_flags.h \
-	xlat/routing_protocols.h xlat/routing_scopes.h \
-	xlat/routing_table_ids.h xlat/routing_types.h \
-	xlat/rtnl_addr_attrs.h xlat/rtnl_addrlabel_attrs.h \
-	xlat/rtnl_dcb_attrs.h xlat/rtnl_ifla_brport_attrs.h \
-	xlat/rtnl_ifla_info_attrs.h xlat/rtnl_ifla_port_attrs.h \
-	xlat/rtnl_ifla_vf_port_attrs.h xlat/rtnl_ifla_xdp_attrs.h \
-	xlat/rtnl_link_attrs.h xlat/rtnl_mdb_attrs.h \
-	xlat/rtnl_mdba_mdb_attrs.h xlat/rtnl_mdba_mdb_eattr_attrs.h \
+	xlat/riscv_flush_icache_flags.h xlat/route_nexthop_flags.h \
+	xlat/routing_flags.h xlat/routing_protocols.h \
+	xlat/routing_scopes.h xlat/routing_table_ids.h \
+	xlat/routing_types.h xlat/rtnl_addr_attrs.h \
+	xlat/rtnl_addrlabel_attrs.h xlat/rtnl_dcb_attrs.h \
+	xlat/rtnl_ifla_brport_attrs.h xlat/rtnl_ifla_info_attrs.h \
+	xlat/rtnl_ifla_port_attrs.h xlat/rtnl_ifla_vf_port_attrs.h \
+	xlat/rtnl_ifla_xdp_attrs.h xlat/rtnl_link_attrs.h \
+	xlat/rtnl_mdb_attrs.h xlat/rtnl_mdba_mdb_attrs.h \
+	xlat/rtnl_mdba_mdb_eattr_attrs.h \
 	xlat/rtnl_mdba_mdb_entry_attrs.h xlat/rtnl_mdba_router_attrs.h \
 	xlat/rtnl_mdba_router_pattr_attrs.h xlat/rtnl_neigh_attrs.h \
 	xlat/rtnl_neightbl_attrs.h xlat/rtnl_neightbl_parms_attrs.h \
@@ -1101,8 +1129,11 @@
 	xlat/rtnl_rule_attrs.h xlat/rtnl_tc_action_attrs.h \
 	xlat/rtnl_tc_attrs.h xlat/rtnl_tca_stab_attrs.h \
 	xlat/rtnl_tca_stats_attrs.h xlat/rwf_flags.h \
-	xlat/sa_handler_values.h xlat/sched_flags.h xlat/schedulers.h \
-	xlat/scmvals.h xlat/scsi_sg_commands.h xlat/secbits.h \
+	xlat/s390_guarded_storage_commands.h \
+	xlat/s390_runtime_instr_commands.h \
+	xlat/s390_sthyi_function_codes.h xlat/sa_handler_values.h \
+	xlat/sched_flags.h xlat/schedulers.h xlat/scmvals.h \
+	xlat/scsi_sg_commands.h xlat/secbits.h \
 	xlat/seccomp_filter_flags.h xlat/seccomp_mode.h \
 	xlat/seccomp_ops.h xlat/seccomp_ret_action.h \
 	xlat/semctl_flags.h xlat/semop_flags.h xlat/setns_types.h \
@@ -1121,13 +1152,13 @@
 	xlat/smc_states.h xlat/sock_type_flags.h xlat/socketcalls.h \
 	xlat/socketlayers.h xlat/sockipoptions.h \
 	xlat/sockipv6options.h xlat/sockipxoptions.h \
-	xlat/sockoptions.h xlat/sockpacketoptions.h \
-	xlat/sockrawoptions.h xlat/socksctpoptions.h \
-	xlat/socktcpoptions.h xlat/socktypes.h xlat/splice_flags.h \
-	xlat/sram_alloc_flags.h xlat/statfs_flags.h xlat/statx_attrs.h \
-	xlat/statx_masks.h xlat/swap_flags.h \
-	xlat/sync_file_range_flags.h xlat/sysctl_kern.h \
-	xlat/sysctl_net.h xlat/sysctl_net_core.h \
+	xlat/socknetlinkoptions.h xlat/sockoptions.h \
+	xlat/sockpacketoptions.h xlat/sockrawoptions.h \
+	xlat/socksctpoptions.h xlat/socktcpoptions.h xlat/socktypes.h \
+	xlat/splice_flags.h xlat/sram_alloc_flags.h \
+	xlat/statfs_flags.h xlat/statx_attrs.h xlat/statx_masks.h \
+	xlat/swap_flags.h xlat/sync_file_range_flags.h \
+	xlat/sysctl_kern.h xlat/sysctl_net.h xlat/sysctl_net_core.h \
 	xlat/sysctl_net_ipv4.h xlat/sysctl_net_ipv4_conf.h \
 	xlat/sysctl_net_ipv4_route.h xlat/sysctl_net_ipv6.h \
 	xlat/sysctl_net_ipv6_route.h xlat/sysctl_net_unix.h \
@@ -1155,18 +1186,20 @@
 	xlat/v4l2_vbi_flags.h xlat/wait4_options.h xlat/waitid_types.h \
 	xlat/whence_codes.h xlat/xattrflags.h xlat/xdp_flags.h \
 	xlat/xfs_dqblk_flags.h xlat/xfs_quota_flags.h
-strace_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_2) \
+strace_CPPFLAGS = $(AM_CPPFLAGS) $(am__append_2) $(am__append_5) \
 	$(CODE_COVERAGE_CPPFLAGS)
 strace_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
-strace_LDFLAGS = $(am__append_3)
-strace_LDADD = libstrace.a $(am__append_4) $(CODE_COVERAGE_LIBS) \
-	$(am__append_5) $(am__append_9)
-noinst_LIBRARIES = libstrace.a $(am__append_6) $(am__append_10)
+strace_LDFLAGS = $(am__append_3) $(am__append_6)
+strace_LDADD = libstrace.a $(am__append_4) $(am__append_7) \
+	$(CODE_COVERAGE_LIBS) $(am__append_8) $(am__append_12)
+noinst_LIBRARIES = libstrace.a $(am__append_9) $(am__append_13)
 libstrace_a_CPPFLAGS = $(strace_CPPFLAGS)
 libstrace_a_CFLAGS = $(strace_CFLAGS)
 libstrace_a_SOURCES = \
+	fetch_indirect_syscall_args.c \
 	fstatfs.c \
 	fstatfs64.c \
+	getpagesize.c \
 	ipc.c \
 	sigreturn.c	\
 	socketcall.c \
@@ -1178,57 +1211,58 @@
 	upoke.c		\
 	# end of libstrace_a_SOURCES
 
-strace_SOURCES = access.c affinity.c aio.c alpha.c basic_filters.c \
-	bind.c bjm.c block.c bpf.c bpf_filter.c bpf_filter.h \
-	bpf_fprog.h bpf_seccomp_filter.c bpf_sock_filter.c btrfs.c \
-	cacheflush.c capability.c caps0.h caps1.h chdir.c chmod.c \
-	clone.c copy_file_range.c count.c defs.h desc.c dirent.c \
-	dirent64.c dm.c dyxlat.c empty.h epoll.c error_prints.c \
-	error_prints.h evdev.c eventfd.c execve.c fadvise.c \
-	fallocate.c fanotify.c fchownat.c fcntl.c fetch_bpf_fprog.c \
-	fetch_struct_flock.c fetch_struct_keyctl_kdf_params.c \
-	fetch_struct_mmsghdr.c fetch_struct_msghdr.c \
-	fetch_struct_stat.c fetch_struct_stat64.c \
-	fetch_struct_statfs.c file_handle.c file_ioctl.c \
-	filter_qualify.c filter.h flock.c flock.h fs_x_ioctl.c futex.c \
-	gcc_compat.h get_robust_list.c getcpu.c getcwd.c getrandom.c \
-	hdio.c hostname.c inotify.c io.c ioctl.c ioperm.c iopl.c \
-	ioprio.c ipc_defs.h ipc_msg.c ipc_msgctl.c ipc_sem.c ipc_shm.c \
-	ipc_shmctl.c kcmp.c kernel_types.h kexec.c keyctl.c \
-	keyctl_kdf_params.h ldt.c link.c linux/asm_stat.h \
-	linux/x32/asm_stat.h linux/x86_64/asm_stat.h listen.c \
-	lookup_dcookie.c loop.c lseek.c macros.h mem.c membarrier.c \
-	memfd_create.c mknod.c mmsghdr.c mount.c mpers_type.h mq.c \
-	msghdr.c msghdr.h mtd.c native_defs.h negated_errno.h net.c \
-	netlink.c netlink.h netlink_crypto.c netlink_sock_diag.h \
-	netlink_inet_diag.c netlink_netlink_diag.c \
-	netlink_packet_diag.c netlink_route.c netlink_route.h \
-	netlink_selinux.c netlink_smc_diag.c netlink_sock_diag.c \
-	netlink_unix_diag.c nlattr.c nlattr.h nsfs.c nsfs.h nsig.h \
-	numa.c number_set.c number_set.h oldstat.c open.c \
-	or1k_atomic.c pathtrace.c perf.c perf_event_struct.h \
-	personality.c pkeys.c poll.c prctl.c print_dev_t.c \
-	print_group_req.c print_fields.h print_ifindex.c \
+strace_SOURCES = access.c affinity.c aio.c alpha.c arch_defs.h \
+	basic_filters.c bind.c bjm.c block.c bpf.c bpf_filter.c \
+	bpf_filter.h bpf_fprog.h bpf_seccomp_filter.c \
+	bpf_sock_filter.c btrfs.c cacheflush.c capability.c caps0.h \
+	caps1.h chdir.c chmod.c clone.c copy_file_range.c count.c \
+	defs.h desc.c dirent.c dirent64.c dm.c dyxlat.c empty.h \
+	epoll.c error_prints.c error_prints.h evdev.c eventfd.c \
+	execve.c fadvise.c fallocate.c fanotify.c fchownat.c fcntl.c \
+	fetch_bpf_fprog.c fetch_struct_flock.c \
+	fetch_struct_keyctl_kdf_params.c fetch_struct_mmsghdr.c \
+	fetch_struct_msghdr.c fetch_struct_stat.c \
+	fetch_struct_stat64.c fetch_struct_statfs.c file_handle.c \
+	file_ioctl.c filter_qualify.c filter.h flock.c flock.h \
+	fs_x_ioctl.c futex.c gcc_compat.h get_robust_list.c getcpu.c \
+	getcwd.c getrandom.c hdio.c hostname.c inotify.c io.c ioctl.c \
+	ioperm.c iopl.c ioprio.c ipc_defs.h ipc_msg.c ipc_msgctl.c \
+	ipc_sem.c ipc_shm.c ipc_shmctl.c kcmp.c kernel_types.h kexec.c \
+	keyctl.c keyctl_kdf_params.h kvm.c largefile_wrappers.h ldt.c \
+	link.c linux/asm_stat.h linux/x32/asm_stat.h \
+	linux/x86_64/asm_stat.h listen.c lookup_dcookie.c loop.c \
+	lseek.c macros.h mem.c membarrier.c memfd_create.c mknod.c \
+	mmsghdr.c mount.c mpers_type.h mq.c msghdr.c msghdr.h mtd.c \
+	native_defs.h negated_errno.h net.c netlink.c netlink.h \
+	netlink_crypto.c netlink_sock_diag.h netlink_inet_diag.c \
+	netlink_netlink_diag.c netlink_packet_diag.c netlink_route.c \
+	netlink_route.h netlink_selinux.c netlink_smc_diag.c \
+	netlink_sock_diag.c netlink_unix_diag.c nlattr.c nlattr.h \
+	nsfs.c nsfs.h nsig.h numa.c number_set.c number_set.h \
+	oldstat.c open.c or1k_atomic.c pathtrace.c perf.c \
+	perf_event_struct.h personality.c pkeys.c poll.c prctl.c \
+	print_dev_t.c print_group_req.c print_fields.h print_ifindex.c \
 	print_mq_attr.c print_msgbuf.c print_sg_req_info.c \
 	print_sigevent.c print_statfs.c print_struct_stat.c \
 	print_time.c print_timespec.c print_timeval.c print_timex.c \
 	printmode.c printrusage.c printsiginfo.c printsiginfo.h \
 	process.c process_vm.c ptp.c ptrace.h quota.c readahead.c \
-	readlink.c reboot.c regs.h renameat.c resource.c rt_sigframe.c \
-	rt_sigreturn.c rtc.c rtnl_addr.c rtnl_addrlabel.c rtnl_dcb.c \
-	rtnl_link.c rtnl_mdb.c rtnl_neigh.c rtnl_neightbl.c \
-	rtnl_netconf.c rtnl_nsid.c rtnl_route.c rtnl_rule.c rtnl_tc.c \
-	rtnl_tc_action.c sched.c sched_attr.h scsi.c seccomp.c \
-	sendfile.c sg_io_v3.c sg_io_v4.c shutdown.c sigaltstack.c \
-	sigevent.h signal.c signalfd.c sock.c sockaddr.c socketutils.c \
-	sram_alloc.c stat.c stat.h stat64.c statfs.c statfs.h statx.c \
-	statx.h strace.c string_to_uint.h string_to_uint.c \
-	supported_personalities.h swapon.c syscall.c sysctl.c sysent.h \
-	sysent_shorthand_defs.h sysent_shorthand_undefs.h sysinfo.c \
-	syslog.c sysmips.c term.c time.c times.c truncate.c ubi.c \
-	ucopy.c uid.c uid16.c umask.c umount.c uname.c userfaultfd.c \
-	ustat.c util.c utime.c utimes.c v4l2.c wait.c xattr.c xlat.c \
-	xlat.h xmalloc.c xmalloc.h $(am__append_1)
+	readlink.c reboot.c regs.h renameat.c resource.c riscv.c \
+	rt_sigframe.c rt_sigreturn.c rtc.c rtnl_addr.c \
+	rtnl_addrlabel.c rtnl_dcb.c rtnl_link.c rtnl_mdb.c \
+	rtnl_neigh.c rtnl_neightbl.c rtnl_netconf.c rtnl_nsid.c \
+	rtnl_route.c rtnl_rule.c rtnl_tc.c rtnl_tc_action.c s390.c \
+	sched.c sched_attr.h scsi.c seccomp.c sendfile.c sg_io_v3.c \
+	sg_io_v4.c shutdown.c sigaltstack.c sigevent.h signal.c \
+	signalfd.c sock.c sockaddr.c socketutils.c sram_alloc.c stat.c \
+	stat.h stat64.c statfs.c statfs.h statx.c statx.h strace.c \
+	string_to_uint.h string_to_uint.c swapon.c syscall.c sysctl.c \
+	sysent.h sysent_shorthand_defs.h sysent_shorthand_undefs.h \
+	sysinfo.c syslog.c sysmips.c term.c time.c times.c \
+	trace_event.h truncate.c ubi.c ucopy.c uid.c uid16.c umask.c \
+	umount.c uname.c userfaultfd.c ustat.c util.c utime.c utimes.c \
+	v4l2.c wait.c xattr.c xlat.c xlat.h xmalloc.c xmalloc.h \
+	xstring.h $(am__append_1)
 CODE_COVERAGE_BRANCH_COVERAGE = 1
 CODE_COVERAGE_GENHTML_OPTIONS = $(CODE_COVERAGE_GENHTML_OPTIONS_DEFAULT) \
 	--prefix $(shell cd $(abs_top_srcdir)/.. && pwd || echo .)
@@ -1269,23 +1303,27 @@
 	linux/32/syscallent.h		\
 	linux/64/ioctls_inc.h		\
 	linux/64/syscallent.h		\
+	linux/aarch64/arch_defs_.h	\
 	linux/aarch64/arch_regs.c	\
 	linux/aarch64/arch_regs.h	\
-	linux/aarch64/arch_rt_sigframe.c\
+	linux/aarch64/arch_rt_sigframe.c	\
 	linux/aarch64/arch_sigreturn.c	\
 	linux/aarch64/errnoent1.h	\
 	linux/aarch64/get_error.c	\
 	linux/aarch64/get_scno.c	\
-	linux/aarch64/get_syscall_args.c\
+	linux/aarch64/get_syscall_args.c	\
 	linux/aarch64/ioctls_arch0.h	\
 	linux/aarch64/ioctls_arch1.h	\
 	linux/aarch64/ioctls_inc0.h	\
 	linux/aarch64/ioctls_inc1.h	\
+	linux/aarch64/nr_prefix.c	\
 	linux/aarch64/set_error.c	\
 	linux/aarch64/set_scno.c	\
+	linux/aarch64/shuffle_scno.c	\
 	linux/aarch64/signalent1.h	\
 	linux/aarch64/syscallent.h	\
 	linux/aarch64/syscallent1.h	\
+	linux/alpha/arch_defs_.h	\
 	linux/alpha/arch_getrval2.c	\
 	linux/alpha/arch_regs.c		\
 	linux/alpha/arch_regs.h		\
@@ -1295,7 +1333,7 @@
 	linux/alpha/get_error.c		\
 	linux/alpha/get_scno.c		\
 	linux/alpha/get_syscall_args.c	\
-	linux/alpha/get_syscall_result.c\
+	linux/alpha/get_syscall_result.c	\
 	linux/alpha/ioctls_arch0.h	\
 	linux/alpha/ioctls_inc0.h	\
 	linux/alpha/set_error.c		\
@@ -1314,8 +1352,11 @@
 	linux/arc/set_error.c		\
 	linux/arc/set_scno.c		\
 	linux/arc/syscallent.h		\
+	linux/arch_defs_.h		\
+	linux/arch_kvm.c		\
 	linux/arch_regs.h		\
 	linux/arch_sigreturn.c		\
+	linux/arm/arch_defs_.h		\
 	linux/arm/arch_regs.c		\
 	linux/arm/arch_regs.h		\
 	linux/arm/arch_rt_sigframe.c	\
@@ -1325,8 +1366,10 @@
 	linux/arm/get_syscall_args.c	\
 	linux/arm/ioctls_arch0.h	\
 	linux/arm/ioctls_inc0.h		\
+	linux/arm/nr_prefix.c		\
 	linux/arm/set_error.c		\
 	linux/arm/set_scno.c		\
+	linux/arm/shuffle_scno.c	\
 	linux/arm/syscallent.h		\
 	linux/arm/userent.h		\
 	linux/avr32/arch_regs.c		\
@@ -1341,6 +1384,7 @@
 	linux/avr32/set_scno.c		\
 	linux/avr32/syscallent.h	\
 	linux/avr32/userent.h		\
+	linux/bfin/arch_defs_.h		\
 	linux/bfin/arch_regs.c		\
 	linux/bfin/arch_rt_sigframe.c	\
 	linux/bfin/get_error.c		\
@@ -1354,33 +1398,10 @@
 	linux/bfin/set_scno.c		\
 	linux/bfin/syscallent.h		\
 	linux/bfin/userent.h		\
-	linux/crisv10/arch_regs.c	\
-	linux/crisv10/arch_rt_sigframe.c\
-	linux/crisv10/arch_sigreturn.c	\
-	linux/crisv10/get_error.c	\
-	linux/crisv10/get_scno.c	\
-	linux/crisv10/get_syscall_args.c	\
-	linux/crisv10/get_syscall_result.c	\
-	linux/crisv10/rt_sigframe.h	\
-	linux/crisv10/set_error.c	\
-	linux/crisv10/set_scno.c	\
-	linux/crisv10/syscallent.h	\
-	linux/crisv10/userent.h		\
-	linux/crisv32/arch_regs.c	\
-	linux/crisv32/arch_rt_sigframe.c\
-	linux/crisv32/arch_sigreturn.c	\
-	linux/crisv32/get_error.c	\
-	linux/crisv32/get_scno.c	\
-	linux/crisv32/get_syscall_args.c	\
-	linux/crisv32/get_syscall_result.c	\
-	linux/crisv32/rt_sigframe.h	\
-	linux/crisv32/set_error.c	\
-	linux/crisv32/set_scno.c	\
-	linux/crisv32/syscallent.h	\
-	linux/crisv32/userent.h		\
 	linux/dummy.h			\
 	linux/errnoent.h		\
 	linux/getregs_old.h		\
+	linux/hppa/arch_defs_.h		\
 	linux/hppa/arch_regs.c		\
 	linux/hppa/arch_regs.h		\
 	linux/hppa/arch_rt_sigframe.c	\
@@ -1396,6 +1417,8 @@
 	linux/hppa/set_scno.c		\
 	linux/hppa/signalent.h		\
 	linux/hppa/syscallent.h		\
+	linux/i386/arch_kvm.c		\
+	linux/i386/arch_defs_.h		\
 	linux/i386/arch_regs.c		\
 	linux/i386/arch_regs.h		\
 	linux/i386/arch_rt_sigframe.c	\
@@ -1411,6 +1434,7 @@
 	linux/i386/syscallent.h		\
 	linux/i386/userent.h		\
 	linux/i386/userent0.h		\
+	linux/ia64/arch_defs_.h		\
 	linux/ia64/arch_getrval2.c	\
 	linux/ia64/arch_regs.c		\
 	linux/ia64/arch_regs.h		\
@@ -1426,6 +1450,7 @@
 	linux/ia64/syscallent.h		\
 	linux/ia64/userent.h		\
 	linux/inet_diag.h		\
+	linux/m68k/arch_defs_.h		\
 	linux/m68k/arch_regs.c		\
 	linux/m68k/arch_regs.h		\
 	linux/m68k/arch_rt_sigframe.c	\
@@ -1451,8 +1476,9 @@
 	linux/metag/set_error.c		\
 	linux/metag/set_scno.c		\
 	linux/metag/syscallent.h	\
+	linux/microblaze/arch_defs_.h	\
 	linux/microblaze/arch_regs.c	\
-	linux/microblaze/arch_rt_sigframe.c\
+	linux/microblaze/arch_rt_sigframe.c	\
 	linux/microblaze/arch_sigreturn.c	\
 	linux/microblaze/get_error.c	\
 	linux/microblaze/get_scno.c	\
@@ -1464,6 +1490,7 @@
 	linux/microblaze/set_scno.c	\
 	linux/microblaze/syscallent.h	\
 	linux/microblaze/userent.h	\
+	linux/mips/arch_defs_.h		\
 	linux/mips/arch_getrval2.c	\
 	linux/mips/arch_regs.c		\
 	linux/mips/arch_regs.h		\
@@ -1486,8 +1513,8 @@
 	linux/mips/syscallent-o32.h	\
 	linux/mips/syscallent.h		\
 	linux/mips/userent.h		\
-	linux/mtd-abi.h			\
 	linux/netlink_diag.h		\
+	linux/nios2/arch_defs_.h	\
 	linux/nios2/arch_regs.c		\
 	linux/nios2/arch_regs.h		\
 	linux/nios2/arch_rt_sigframe.c	\
@@ -1499,6 +1526,7 @@
 	linux/nios2/set_error.c		\
 	linux/nios2/set_scno.c		\
 	linux/nios2/syscallent.h	\
+	linux/nr_prefix.c		\
 	linux/or1k/arch_regs.c		\
 	linux/or1k/arch_regs.h		\
 	linux/or1k/arch_rt_sigframe.c	\
@@ -1512,10 +1540,10 @@
 	linux/or1k/syscallent.h		\
 	linux/or1k/userent.h		\
 	linux/packet_diag.h		\
-	linux/personality.h		\
+	linux/powerpc/arch_defs_.h	\
 	linux/powerpc/arch_regs.c	\
 	linux/powerpc/arch_regs.h	\
-	linux/powerpc/arch_rt_sigframe.c\
+	linux/powerpc/arch_rt_sigframe.c	\
 	linux/powerpc/arch_sigreturn.c	\
 	linux/powerpc/errnoent.h	\
 	linux/powerpc/get_error.c	\
@@ -1529,9 +1557,10 @@
 	linux/powerpc/set_scno.c	\
 	linux/powerpc/syscallent.h	\
 	linux/powerpc/userent.h		\
+	linux/powerpc64/arch_defs_.h	\
 	linux/powerpc64/arch_regs.c	\
 	linux/powerpc64/arch_regs.h	\
-	linux/powerpc64/arch_rt_sigframe.c\
+	linux/powerpc64/arch_rt_sigframe.c	\
 	linux/powerpc64/arch_sigreturn.c	\
 	linux/powerpc64/errnoent.h	\
 	linux/powerpc64/errnoent1.h	\
@@ -1551,7 +1580,7 @@
 	linux/powerpc64/syscallent.h	\
 	linux/powerpc64/syscallent1.h	\
 	linux/powerpc64/userent.h	\
-	linux/ptp_clock.h		\
+	linux/riscv/arch_defs_.h	\
 	linux/riscv/arch_regs.c		\
 	linux/riscv/arch_regs.h		\
 	linux/riscv/arch_rt_sigframe.c	\
@@ -1569,6 +1598,7 @@
 	linux/riscv/syscallent.h	\
 	linux/riscv/syscallent1.h	\
 	linux/rt_sigframe.h		\
+	linux/s390/arch_defs_.h		\
 	linux/s390/arch_regs.c		\
 	linux/s390/arch_regs.h		\
 	linux/s390/arch_rt_sigframe.c	\
@@ -1585,20 +1615,27 @@
 	linux/s390/userent.h		\
 	linux/s390/userent0.h		\
 	linux/s390/userent1.h		\
+	linux/s390x/arch_defs_.h	\
 	linux/s390x/arch_regs.c		\
 	linux/s390x/arch_regs.h		\
 	linux/s390x/arch_rt_sigframe.c	\
 	linux/s390x/arch_sigreturn.c	\
+	linux/s390x/errnoent1.h		\
 	linux/s390x/get_error.c		\
 	linux/s390x/get_scno.c		\
 	linux/s390x/get_syscall_args.c	\
 	linux/s390x/ioctls_arch0.h	\
+	linux/s390x/ioctls_arch1.h	\
 	linux/s390x/ioctls_inc0.h	\
+	linux/s390x/ioctls_inc1.h	\
 	linux/s390x/rt_sigframe.h	\
 	linux/s390x/set_error.c		\
 	linux/s390x/set_scno.c		\
+	linux/s390x/signalent1.h	\
 	linux/s390x/syscallent.h	\
+	linux/s390x/syscallent1.h	\
 	linux/s390x/userent.h		\
+	linux/sh/arch_defs_.h		\
 	linux/sh/arch_getrval2.c	\
 	linux/sh/arch_regs.c		\
 	linux/sh/arch_rt_sigframe.c	\
@@ -1613,6 +1650,7 @@
 	linux/sh/syscallent.h		\
 	linux/sh/userent.h		\
 	linux/sh/userent0.h		\
+	linux/sh64/arch_defs_.h		\
 	linux/sh64/arch_regs.c		\
 	linux/sh64/arch_regs.h		\
 	linux/sh64/arch_rt_sigframe.c	\
@@ -1627,16 +1665,17 @@
 	linux/sh64/set_scno.c		\
 	linux/sh64/syscallent.h		\
 	linux/sh64/userent.h		\
+	linux/shuffle_scno.c		\
 	linux/signalent.h		\
 	linux/smc_diag.h		\
 	linux/sock_diag.h		\
+	linux/sparc/arch_defs_.h	\
 	linux/sparc/arch_getrval2.c	\
 	linux/sparc/arch_regs.c		\
 	linux/sparc/arch_regs.h		\
 	linux/sparc/arch_rt_sigframe.c	\
 	linux/sparc/arch_sigreturn.c	\
 	linux/sparc/errnoent.h		\
-	linux/sparc/gen.pl		\
 	linux/sparc/get_error.c		\
 	linux/sparc/get_scno.c		\
 	linux/sparc/get_syscall_args.c	\
@@ -1648,16 +1687,17 @@
 	linux/sparc/signalent.h		\
 	linux/sparc/syscallent.h	\
 	linux/sparc/userent.h		\
+	linux/sparc64/arch_defs_.h	\
 	linux/sparc64/arch_getrval2.c	\
 	linux/sparc64/arch_regs.c	\
 	linux/sparc64/arch_regs.h	\
-	linux/sparc64/arch_rt_sigframe.c\
+	linux/sparc64/arch_rt_sigframe.c	\
 	linux/sparc64/arch_sigreturn.c	\
 	linux/sparc64/errnoent.h	\
 	linux/sparc64/errnoent1.h	\
 	linux/sparc64/get_error.c	\
 	linux/sparc64/get_scno.c	\
-	linux/sparc64/get_syscall_args.c\
+	linux/sparc64/get_syscall_args.c	\
 	linux/sparc64/ioctls_arch0.h	\
 	linux/sparc64/ioctls_arch1.h	\
 	linux/sparc64/ioctls_inc0.h	\
@@ -1672,6 +1712,7 @@
 	linux/sparc64/userent.h		\
 	linux/subcall.h			\
 	linux/syscall.h			\
+	linux/tile/arch_defs_.h		\
 	linux/tile/arch_regs.c		\
 	linux/tile/arch_regs.h		\
 	linux/tile/arch_rt_sigframe.c	\
@@ -1691,10 +1732,11 @@
 	linux/tile/syscallent.h		\
 	linux/tile/syscallent1.h	\
 	linux/tile/userent.h		\
-	linux/ubi-user.h		\
 	linux/unix_diag.h		\
 	linux/userent.h			\
 	linux/userent0.h		\
+	linux/x32/arch_defs_.h		\
+	linux/x32/arch_kvm.c		\
 	linux/x32/arch_regs.c		\
 	linux/x32/arch_regs.h		\
 	linux/x32/arch_rt_sigframe.c	\
@@ -1710,17 +1752,19 @@
 	linux/x32/rt_sigframe.h		\
 	linux/x32/set_error.c		\
 	linux/x32/set_scno.c		\
+	linux/x32/shuffle_scno.c	\
 	linux/x32/signalent1.h		\
 	linux/x32/syscallent.h		\
 	linux/x32/syscallent1.h		\
 	linux/x32/userent.h		\
+	linux/x86_64/arch_defs_.h	\
+	linux/x86_64/arch_kvm.c		\
 	linux/x86_64/arch_regs.c	\
 	linux/x86_64/arch_regs.h	\
 	linux/x86_64/arch_rt_sigframe.c	\
 	linux/x86_64/arch_sigreturn.c	\
 	linux/x86_64/errnoent1.h	\
 	linux/x86_64/errnoent2.h	\
-	linux/x86_64/gentab.pl		\
 	linux/x86_64/get_error.c	\
 	linux/x86_64/get_scno.c		\
 	linux/x86_64/get_syscall_args.c	\
@@ -1735,6 +1779,7 @@
 	linux/x86_64/rt_sigframe.h	\
 	linux/x86_64/set_error.c	\
 	linux/x86_64/set_scno.c		\
+	linux/x86_64/shuffle_scno.c	\
 	linux/x86_64/signalent1.h	\
 	linux/x86_64/signalent2.h	\
 	linux/x86_64/syscallent.h	\
@@ -1764,7 +1809,7 @@
 	$(XLAT_INPUT_FILES)		\
 	$(XLAT_HEADER_FILES)		\
 	xlat/gen.sh			\
-	xlate.el
+	# end of EXTRA_DIST
 
 strace_SOURCES_c = \
 	$(filter %.c,$(strace_SOURCES)) $(filter %.c,$(libstrace_a_SOURCES))
@@ -1788,11 +1833,11 @@
 ioctl_redefs_h = $(filter-out ioctl_redefs0.h,$(subst ioctlent,ioctl_redefs,$(ioctlent_h)))
 BUILT_SOURCES = $(ioctl_redefs_h) $(ioctlent_h) native_printer_decls.h \
 	native_printer_defs.h printers.h sen.h sys_func.h .version \
-	scno.h $(am__append_7) $(am__append_11)
+	scno.h $(am__append_10) $(am__append_14)
 CLEANFILES = $(ioctl_redefs_h) $(ioctlent_h) $(mpers_preproc_files) \
 	ioctl_iocdef.h ioctl_iocdef.i native_printer_decls.h \
 	native_printer_defs.h printers.h sen.h sys_func.h syscallent.i \
-	scno.h $(am__append_8) $(am__append_12)
+	scno.h $(am__append_11) $(am__append_15)
 DISTCLEANFILES = gnu/stubs-32.h gnu/stubs-x32.h
 SCNO_CPPFLAGS = $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 		$(ARCH_MFLAGS) $(AM_CPPFLAGS) $(CPPFLAGS)
@@ -1882,6 +1927,8 @@
 	-rm -f config.h stamp-h1
 strace.1: $(top_builddir)/config.status $(srcdir)/strace.1.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
+strace-log-merge.1: $(top_builddir)/config.status $(srcdir)/strace-log-merge.1.in
+	cd $(top_builddir) && $(SHELL) ./config.status $@
 strace.spec: $(top_builddir)/config.status $(srcdir)/strace.spec.in
 	cd $(top_builddir) && $(SHELL) ./config.status $@
 debian/changelog: $(top_builddir)/config.status $(top_srcdir)/debian/changelog.in
@@ -2068,8 +2115,10 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-ustat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-utime.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libmpers_mx32_a-v4l2.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-fstatfs64.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-getpagesize.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-ipc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-sigreturn.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libstrace_a-socketcall.Po@am__quote@
@@ -2148,6 +2197,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kcmp.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kexec.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-keyctl.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-kvm.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-ldt.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-link.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-listen.Po@am__quote@
@@ -2212,6 +2262,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-reboot.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-renameat.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-resource.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-riscv.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rt_sigframe.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rt_sigreturn.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtc.Po@am__quote@
@@ -2228,6 +2279,7 @@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_rule.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_tc.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-rtnl_tc_action.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-s390.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-sched.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-scsi.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/strace-seccomp.Po@am__quote@
@@ -3355,6 +3407,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libmpers_mx32_a_CPPFLAGS) $(CPPFLAGS) $(libmpers_mx32_a_CFLAGS) $(CFLAGS) -c -o libmpers_mx32_a-v4l2.obj `if test -f 'v4l2.c'; then $(CYGPATH_W) 'v4l2.c'; else $(CYGPATH_W) '$(srcdir)/v4l2.c'; fi`
 
+libstrace_a-fetch_indirect_syscall_args.o: fetch_indirect_syscall_args.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fetch_indirect_syscall_args.o -MD -MP -MF $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo -c -o libstrace_a-fetch_indirect_syscall_args.o `test -f 'fetch_indirect_syscall_args.c' || echo '$(srcdir)/'`fetch_indirect_syscall_args.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='fetch_indirect_syscall_args.c' object='libstrace_a-fetch_indirect_syscall_args.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fetch_indirect_syscall_args.o `test -f 'fetch_indirect_syscall_args.c' || echo '$(srcdir)/'`fetch_indirect_syscall_args.c
+
+libstrace_a-fetch_indirect_syscall_args.obj: fetch_indirect_syscall_args.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fetch_indirect_syscall_args.obj -MD -MP -MF $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo -c -o libstrace_a-fetch_indirect_syscall_args.obj `if test -f 'fetch_indirect_syscall_args.c'; then $(CYGPATH_W) 'fetch_indirect_syscall_args.c'; else $(CYGPATH_W) '$(srcdir)/fetch_indirect_syscall_args.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Tpo $(DEPDIR)/libstrace_a-fetch_indirect_syscall_args.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='fetch_indirect_syscall_args.c' object='libstrace_a-fetch_indirect_syscall_args.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fetch_indirect_syscall_args.obj `if test -f 'fetch_indirect_syscall_args.c'; then $(CYGPATH_W) 'fetch_indirect_syscall_args.c'; else $(CYGPATH_W) '$(srcdir)/fetch_indirect_syscall_args.c'; fi`
+
 libstrace_a-fstatfs.o: fstatfs.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-fstatfs.o -MD -MP -MF $(DEPDIR)/libstrace_a-fstatfs.Tpo -c -o libstrace_a-fstatfs.o `test -f 'fstatfs.c' || echo '$(srcdir)/'`fstatfs.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-fstatfs.Tpo $(DEPDIR)/libstrace_a-fstatfs.Po
@@ -3383,6 +3449,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-fstatfs64.obj `if test -f 'fstatfs64.c'; then $(CYGPATH_W) 'fstatfs64.c'; else $(CYGPATH_W) '$(srcdir)/fstatfs64.c'; fi`
 
+libstrace_a-getpagesize.o: getpagesize.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-getpagesize.o -MD -MP -MF $(DEPDIR)/libstrace_a-getpagesize.Tpo -c -o libstrace_a-getpagesize.o `test -f 'getpagesize.c' || echo '$(srcdir)/'`getpagesize.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-getpagesize.Tpo $(DEPDIR)/libstrace_a-getpagesize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='getpagesize.c' object='libstrace_a-getpagesize.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-getpagesize.o `test -f 'getpagesize.c' || echo '$(srcdir)/'`getpagesize.c
+
+libstrace_a-getpagesize.obj: getpagesize.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-getpagesize.obj -MD -MP -MF $(DEPDIR)/libstrace_a-getpagesize.Tpo -c -o libstrace_a-getpagesize.obj `if test -f 'getpagesize.c'; then $(CYGPATH_W) 'getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/getpagesize.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-getpagesize.Tpo $(DEPDIR)/libstrace_a-getpagesize.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='getpagesize.c' object='libstrace_a-getpagesize.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -c -o libstrace_a-getpagesize.obj `if test -f 'getpagesize.c'; then $(CYGPATH_W) 'getpagesize.c'; else $(CYGPATH_W) '$(srcdir)/getpagesize.c'; fi`
+
 libstrace_a-ipc.o: ipc.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libstrace_a_CPPFLAGS) $(CPPFLAGS) $(libstrace_a_CFLAGS) $(CFLAGS) -MT libstrace_a-ipc.o -MD -MP -MF $(DEPDIR)/libstrace_a-ipc.Tpo -c -o libstrace_a-ipc.o `test -f 'ipc.c' || echo '$(srcdir)/'`ipc.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/libstrace_a-ipc.Tpo $(DEPDIR)/libstrace_a-ipc.Po
@@ -4475,6 +4555,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-keyctl.obj `if test -f 'keyctl.c'; then $(CYGPATH_W) 'keyctl.c'; else $(CYGPATH_W) '$(srcdir)/keyctl.c'; fi`
 
+strace-kvm.o: kvm.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kvm.o -MD -MP -MF $(DEPDIR)/strace-kvm.Tpo -c -o strace-kvm.o `test -f 'kvm.c' || echo '$(srcdir)/'`kvm.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-kvm.Tpo $(DEPDIR)/strace-kvm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='kvm.c' object='strace-kvm.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kvm.o `test -f 'kvm.c' || echo '$(srcdir)/'`kvm.c
+
+strace-kvm.obj: kvm.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-kvm.obj -MD -MP -MF $(DEPDIR)/strace-kvm.Tpo -c -o strace-kvm.obj `if test -f 'kvm.c'; then $(CYGPATH_W) 'kvm.c'; else $(CYGPATH_W) '$(srcdir)/kvm.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-kvm.Tpo $(DEPDIR)/strace-kvm.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='kvm.c' object='strace-kvm.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-kvm.obj `if test -f 'kvm.c'; then $(CYGPATH_W) 'kvm.c'; else $(CYGPATH_W) '$(srcdir)/kvm.c'; fi`
+
 strace-ldt.o: ldt.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-ldt.o -MD -MP -MF $(DEPDIR)/strace-ldt.Tpo -c -o strace-ldt.o `test -f 'ldt.c' || echo '$(srcdir)/'`ldt.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-ldt.Tpo $(DEPDIR)/strace-ldt.Po
@@ -5371,6 +5465,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-resource.obj `if test -f 'resource.c'; then $(CYGPATH_W) 'resource.c'; else $(CYGPATH_W) '$(srcdir)/resource.c'; fi`
 
+strace-riscv.o: riscv.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-riscv.o -MD -MP -MF $(DEPDIR)/strace-riscv.Tpo -c -o strace-riscv.o `test -f 'riscv.c' || echo '$(srcdir)/'`riscv.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-riscv.Tpo $(DEPDIR)/strace-riscv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='riscv.c' object='strace-riscv.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-riscv.o `test -f 'riscv.c' || echo '$(srcdir)/'`riscv.c
+
+strace-riscv.obj: riscv.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-riscv.obj -MD -MP -MF $(DEPDIR)/strace-riscv.Tpo -c -o strace-riscv.obj `if test -f 'riscv.c'; then $(CYGPATH_W) 'riscv.c'; else $(CYGPATH_W) '$(srcdir)/riscv.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-riscv.Tpo $(DEPDIR)/strace-riscv.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='riscv.c' object='strace-riscv.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-riscv.obj `if test -f 'riscv.c'; then $(CYGPATH_W) 'riscv.c'; else $(CYGPATH_W) '$(srcdir)/riscv.c'; fi`
+
 strace-rt_sigframe.o: rt_sigframe.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-rt_sigframe.o -MD -MP -MF $(DEPDIR)/strace-rt_sigframe.Tpo -c -o strace-rt_sigframe.o `test -f 'rt_sigframe.c' || echo '$(srcdir)/'`rt_sigframe.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-rt_sigframe.Tpo $(DEPDIR)/strace-rt_sigframe.Po
@@ -5595,6 +5703,20 @@
 @AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-rtnl_tc_action.obj `if test -f 'rtnl_tc_action.c'; then $(CYGPATH_W) 'rtnl_tc_action.c'; else $(CYGPATH_W) '$(srcdir)/rtnl_tc_action.c'; fi`
 
+strace-s390.o: s390.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-s390.o -MD -MP -MF $(DEPDIR)/strace-s390.Tpo -c -o strace-s390.o `test -f 's390.c' || echo '$(srcdir)/'`s390.c
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-s390.Tpo $(DEPDIR)/strace-s390.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='s390.c' object='strace-s390.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-s390.o `test -f 's390.c' || echo '$(srcdir)/'`s390.c
+
+strace-s390.obj: s390.c
+@am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-s390.obj -MD -MP -MF $(DEPDIR)/strace-s390.Tpo -c -o strace-s390.obj `if test -f 's390.c'; then $(CYGPATH_W) 's390.c'; else $(CYGPATH_W) '$(srcdir)/s390.c'; fi`
+@am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-s390.Tpo $(DEPDIR)/strace-s390.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	$(AM_V_CC)source='s390.c' object='strace-s390.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@	DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@	$(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -c -o strace-s390.obj `if test -f 's390.c'; then $(CYGPATH_W) 's390.c'; else $(CYGPATH_W) '$(srcdir)/s390.c'; fi`
+
 strace-sched.o: sched.c
 @am__fastdepCC_TRUE@	$(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(strace_CPPFLAGS) $(CPPFLAGS) $(strace_CFLAGS) $(CFLAGS) -MT strace-sched.o -MD -MP -MF $(DEPDIR)/strace-sched.Tpo -c -o strace-sched.o `test -f 'sched.c' || echo '$(srcdir)/'`sched.c
 @am__fastdepCC_TRUE@	$(AM_V_at)$(am__mv) $(DEPDIR)/strace-sched.Tpo $(DEPDIR)/strace-sched.Po
@@ -7075,6 +7197,8 @@
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/keyctl_commands.h: $(top_srcdir)/xlat/keyctl_commands.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/kvm_mem_flags.h: $(top_srcdir)/xlat/kvm_mem_flags.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/lockfcmds.h: $(top_srcdir)/xlat/lockfcmds.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/loop_cmds.h: $(top_srcdir)/xlat/loop_cmds.in $(top_srcdir)/xlat/gen.sh
@@ -7299,6 +7423,8 @@
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/resources.h: $(top_srcdir)/xlat/resources.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/riscv_flush_icache_flags.h: $(top_srcdir)/xlat/riscv_flush_icache_flags.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/route_nexthop_flags.h: $(top_srcdir)/xlat/route_nexthop_flags.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/routing_flags.h: $(top_srcdir)/xlat/routing_flags.in $(top_srcdir)/xlat/gen.sh
@@ -7367,6 +7493,12 @@
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/rwf_flags.h: $(top_srcdir)/xlat/rwf_flags.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/s390_guarded_storage_commands.h: $(top_srcdir)/xlat/s390_guarded_storage_commands.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/s390_runtime_instr_commands.h: $(top_srcdir)/xlat/s390_runtime_instr_commands.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/s390_sthyi_function_codes.h: $(top_srcdir)/xlat/s390_sthyi_function_codes.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/sa_handler_values.h: $(top_srcdir)/xlat/sa_handler_values.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/sched_flags.h: $(top_srcdir)/xlat/sched_flags.in $(top_srcdir)/xlat/gen.sh
@@ -7467,6 +7599,8 @@
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/sockipxoptions.h: $(top_srcdir)/xlat/sockipxoptions.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
+$(top_srcdir)/xlat/socknetlinkoptions.h: $(top_srcdir)/xlat/socknetlinkoptions.in $(top_srcdir)/xlat/gen.sh
+	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/sockoptions.h: $(top_srcdir)/xlat/sockoptions.in $(top_srcdir)/xlat/gen.sh
 	$(AM_V_GEN)$(top_srcdir)/xlat/gen.sh $< $@
 $(top_srcdir)/xlat/sockpacketoptions.h: $(top_srcdir)/xlat/sockpacketoptions.in $(top_srcdir)/xlat/gen.sh
@@ -7695,9 +7829,12 @@
 
 mpers-m%.stamp: $(srcdir_mpers_source_files) | printers.h
 	for f in $^; do \
-		CC="$(CC)" CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
-		CPP="$(CPP)" CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
-		$(srcdir)/mpers.sh -$(mpers_NAME) $$f || exit; \
+		READELF="$(READELF)" \
+		CC="$(CC)" \
+		CFLAGS="$(mpers_sh_opts) -DMPERS_IS_$(mpers_NAME)" \
+		CPP="$(CPP)" \
+		CPPFLAGS="$(mpers_sh_opts) -DIN_MPERS -DMPERS_IS_$(mpers_NAME)" \
+		$(srcdir)/mpers.sh $(mpers_NAME) $(mpers_CC_FLAGS) $$f || exit; \
 	done
 	> $@
 
@@ -7754,8 +7891,10 @@
 native_printer_decls.h native_printer_defs.h: mpers_PREFIX =
 
 @HAVE_M32_MPERS_TRUE@$(mpers_m32_targets): mpers_NAME = m32
+@HAVE_M32_MPERS_TRUE@$(mpers_m32_targets): mpers_CC_FLAGS = @cc_flags_m32@
 
 @HAVE_MX32_MPERS_TRUE@$(mpers_mx32_targets): mpers_NAME = mx32
+@HAVE_MX32_MPERS_TRUE@$(mpers_mx32_targets): mpers_CC_FLAGS = @cc_flags_mx32@
 
 clean-local:
 	-rm -rf mpers-m32 mpers-mx32
diff --git a/NEWS b/NEWS
index 03f8375..868e30c 100644
--- a/NEWS
+++ b/NEWS
@@ -1,3 +1,76 @@
+Noteworthy changes in release 4.21 (2018-02-13)
+===============================================
+
+* Changes in behaviour
+  * Warning is now issued when -F option is used.
+  * Warning is now issued when a tracee with unsupported personality
+    is attached.
+  * Unknown syscall numbers are now printed in hexadecimal form.
+
+* Improvements
+  * Implemented decoding of netlink descriptor attributes as file descriptors.
+  * Implemented decoding of hugetlb page size selection flags.
+  * Implemented decoding of BPF_PROG_TEST_RUN, BPF_PROG_GET_NEXT_ID,
+    BPF_MAP_GET_NEXT_ID, BPF_PROG_GET_FD_BY_ID, BPF_MAP_GET_FD_BY_ID,
+    and BPF_OBJ_GET_INFO_BY_FD commands of bpf syscall.
+  * Enhanced decoding of get_thread_area, memfd_create, modify_ldt,
+    perf_event_open, reboot, s390_guarded_storage, s390_pcio_mmio_read,
+    s390_pci_mmio_write, s390_runtime_instr, s390_sthyi, set_thread_area,
+    and shmget syscalls.
+  * Implemented decoding of KVM_* and DM_LIST_DEVICES ioctl commands.
+  * Implemented decoding of riscv_flush_icache syscall.
+  * Enhanced decoding of getsockopt and setsockopt syscalls for SOL_NETLINK
+    level.
+  * Enhanced decoding of BPF_MAP_CREATE command of bpf syscall.
+  * Print values returned by mq_open syscall and first arguments
+    of mq_getsetattr, mq_notify, mq_timedreceive, and mq_timedsend syscalls
+    as file descriptors.
+  * Added decoding of get_tls syscall on arm.
+  * Added -e trace=%pure option for tracing system calls with no arguments that
+    never fail.
+  * Updated lists of IPV6_*, MAP_*, MEMBARRIER_CMD_*, MSG_*, NT_*, PKEY_*,
+    SHM_*, and TCP_* constants.
+  * Added manual page for the strace-log-merge command.
+  * Updated lists of ioctl commands from Linux 4.15.
+  * Implemented biarch support for s390x.
+  * Implemented an optional support for symbol demangling in strace -k output
+    (activated by --with-libiberty configure option).
+  * Information about availability of demangling and reliable personality
+    decoding (on architectures with multiple personalities) is now available
+    in strace -V output.
+  * Added decoding of pkey_alloc, pkey_free, and pkey_mprotect syscalls on
+    powerpc and powerpc64.
+  * Enhanced manual page.
+
+* Bug fixes
+  * Fixed multi-personality support in cross builds.
+  * Added mq_getsetattr, mq_notify, mq_open, mq_timedreceive, and mq_timedsend
+    syscalls to %desc tracing set.
+  * Fixed path tracing support for mmap syscalls with indirect arguments and
+    for old select syscall.
+  * Fixed decoding of arm-specific (__ARM_NR_*) syscalls.
+  * Fixed open mode flags decoding.
+  * Fixed corner cases in handling of strace -ff -ttt logs by strace-log-merge.
+  * Error counts that exceed one billion are now printed correctly in call
+    summary output.
+  * Fixed call summary header for x32 personality.
+  * Changes of tracee personalities are reported more reliably.
+  * Fixed the case when strace attaches to a tracee being inside exec and its
+    first syscall stop is syscall-exit-stop instead of syscall-enter-stop,
+    which messed up all the syscall state tracking.
+  * Fixed printing of higher 32 bits of the return value for x32 personality.
+
+* Portability
+  * A C compiler that supports "for" loop initial declarations is now required.
+  * Inability to configure multiple personality support on architectures where
+    multiple personalities are supported leads to configuration failure during
+    build now.  Use --enable-mpers=check to revert to the old behaviour.
+  * Build-time requirement for the mpers support has been lowered from gawk 4
+    to gawk 3.
+  * Removed incomplete and non-functional support for the CRIS architecture.
+  * Removed incomplete and unused support for IA-32 mode on the IA-64
+    architecture.
+
 Noteworthy changes in release 4.20 (2017-11-13)
 ===============================================
 
diff --git a/aclocal.m4 b/aclocal.m4
index 1d14520..cca8cf2 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1204,7 +1204,6 @@
 m4_include([m4/ax_prog_cc_for_build.m4])
 m4_include([m4/ax_valgrind_check.m4])
 m4_include([m4/mpers.m4])
-m4_include([m4/st_bpf.m4])
 m4_include([m4/st_save_restore_var.m4])
 m4_include([m4/st_warn_cflags.m4])
 m4_include([m4/warnings.m4])
diff --git a/alpha.c b/alpha.c
index 70d4ca5..376ec0f 100644
--- a/alpha.c
+++ b/alpha.c
@@ -1,5 +1,6 @@
 /*
  * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2016-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -29,6 +30,8 @@
 
 #ifdef ALPHA
 
+# include "xstring.h"
+
 static int
 decode_getxxid(struct tcb *tcp, const char *what)
 {
@@ -40,7 +43,7 @@
 		return 0;
 	static const char const fmt[] = "%s %ld";
 	static char outstr[sizeof(fmt) + 3 * sizeof(rval)];
-	snprintf(outstr, sizeof(outstr), fmt, what, rval);
+	xsprintf(outstr, fmt, what, rval);
 	tcp->auxstr = outstr;
 	return RVAL_STR;
 }
diff --git a/arch_defs.h b/arch_defs.h
new file mode 100644
index 0000000..8844151
--- /dev/null
+++ b/arch_defs.h
@@ -0,0 +1,8 @@
+/* Aarch-specific definitions.  */
+#ifndef STRACE_ARCH_DEFS_H
+#define STRACE_ARCH_DEFS_H
+
+#include "arch_defs_.h"
+#include "linux/arch_defs_.h"
+
+#endif /* !STRACE_ARCH_DEFS_H */
diff --git a/basic_filters.c b/basic_filters.c
index 7b7f0a5..4ea23b5 100644
--- a/basic_filters.c
+++ b/basic_filters.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2016-2017 The strace developers.
+ * Copyright (c) 2016-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,13 +38,11 @@
 	if (n < 0)
 		return false;
 
-	unsigned int p;
 	bool done = false;
 
-	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
-		if ((unsigned) n >= nsyscall_vec[p]) {
+	for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+		if ((unsigned) n >= nsyscall_vec[p])
 			continue;
-		}
 		add_number_to_set_array(n, set, p);
 		done = true;
 	}
@@ -71,12 +69,10 @@
 	if ((rc = regcomp(&preg, s, REG_EXTENDED | REG_NOSUB)) != 0)
 		regerror_msg_and_die(rc, &preg, "regcomp", s);
 
-	unsigned int p;
 	bool found = false;
-	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
-		unsigned int i;
 
-		for (i = 0; i < nsyscall_vec[p]; ++i) {
+	for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+		for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
 			if (!sysent_vec[p][i].sys_name)
 				continue;
 			rc = regexec(&preg, sysent_vec[p][i].sys_name,
@@ -101,13 +97,6 @@
 		const char *name;
 		unsigned int value;
 	} syscall_class[] = {
-		{ "desc",	TRACE_DESC	},
-		{ "file",	TRACE_FILE	},
-		{ "memory",	TRACE_MEMORY	},
-		{ "process",	TRACE_PROCESS	},
-		{ "signal",	TRACE_SIGNAL	},
-		{ "ipc",	TRACE_IPC	},
-		{ "network",	TRACE_NETWORK	},
 		{ "%desc",	TRACE_DESC	},
 		{ "%file",	TRACE_FILE	},
 		{ "%memory",	TRACE_MEMORY	},
@@ -122,13 +111,20 @@
 		{ "%statfs",	TRACE_STATFS	},
 		{ "%fstatfs",	TRACE_FSTATFS	},
 		{ "%%statfs",	TRACE_STATFS_LIKE	},
+		{ "%pure",	TRACE_PURE	},
+		/* legacy class names */
+		{ "desc",	TRACE_DESC	},
+		{ "file",	TRACE_FILE	},
+		{ "memory",	TRACE_MEMORY	},
+		{ "process",	TRACE_PROCESS	},
+		{ "signal",	TRACE_SIGNAL	},
+		{ "ipc",	TRACE_IPC	},
+		{ "network",	TRACE_NETWORK	},
 	};
 
-	unsigned int i;
-	for (i = 0; i < ARRAY_SIZE(syscall_class); ++i) {
-		if (strcmp(s, syscall_class[i].name) == 0) {
+	for (unsigned int i = 0; i < ARRAY_SIZE(syscall_class); ++i) {
+		if (strcmp(s, syscall_class[i].name) == 0)
 			return syscall_class[i].value;
-		}
 	}
 
 	return 0;
@@ -141,37 +137,42 @@
 	if (!n)
 		return false;
 
-	unsigned int p;
-	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
-		unsigned int i;
-
-		for (i = 0; i < nsyscall_vec[p]; ++i) {
-			if (!sysent_vec[p][i].sys_name
-			    || (sysent_vec[p][i].sys_flags & n) != n) {
-				continue;
-			}
-			add_number_to_set_array(i, set, p);
+	for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+		for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
+			if (sysent_vec[p][i].sys_name &&
+			    (sysent_vec[p][i].sys_flags & n) == n)
+				add_number_to_set_array(i, set, p);
 		}
 	}
 
 	return true;
 }
 
+kernel_long_t
+scno_by_name(const char *s, unsigned int p, kernel_long_t start)
+{
+	if (p >= SUPPORTED_PERSONALITIES)
+		return -1;
+
+	for (kernel_ulong_t i = start; i < nsyscall_vec[p]; ++i) {
+		if (sysent_vec[p][i].sys_name &&
+		    strcmp(s, sysent_vec[p][i].sys_name) == 0)
+			return i;
+	}
+
+	return -1;
+}
+
 static bool
 qualify_syscall_name(const char *s, struct number_set *set)
 {
-	unsigned int p;
 	bool found = false;
 
-	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
-		unsigned int i;
-
-		for (i = 0; i < nsyscall_vec[p]; ++i) {
-			if (!sysent_vec[p][i].sys_name
-			    || strcmp(s, sysent_vec[p][i].sys_name)) {
-				continue;
-			}
-			add_number_to_set_array(i, set, p);
+	for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+		for (kernel_long_t scno = 0;
+		     (scno = scno_by_name(s, p, scno)) >= 0;
+		     ++scno) {
+			add_number_to_set_array(scno, set, p);
 			found = true;
 		}
 	}
@@ -202,8 +203,7 @@
  * according to STR specification.
  */
 void
-qualify_syscall_tokens(const char *const str, struct number_set *const set,
-		       const char *const name)
+qualify_syscall_tokens(const char *const str, struct number_set *const set)
 {
 	/* Clear all sets. */
 	clear_number_set_array(set, SUPPORTED_PERSONALITIES);
@@ -213,7 +213,6 @@
 	 * of the remaining specification.
 	 */
 	const char *s = str;
-handle_inversion:
 	while (*s == '!') {
 		invert_number_set_array(set, SUPPORTED_PERSONALITIES);
 		++s;
@@ -227,8 +226,9 @@
 		 */
 		return;
 	} else if (strcmp(s, "all") == 0) {
-		s = "!none";
-		goto handle_inversion;
+		/* "all" == "!none" */
+		invert_number_set_array(set, SUPPORTED_PERSONALITIES);
+		return;
 	}
 
 	/*
@@ -240,22 +240,19 @@
 	 */
 	char *copy = xstrdup(s);
 	char *saveptr = NULL;
-	const char *token;
 	bool done = false;
 
-	for (token = strtok_r(copy, ",", &saveptr); token;
-	     token = strtok_r(NULL, ",", &saveptr)) {
+	for (const char *token = strtok_r(copy, ",", &saveptr);
+	     token; token = strtok_r(NULL, ",", &saveptr)) {
 		done = qualify_syscall(token, set);
-		if (!done) {
-			error_msg_and_die("invalid %s '%s'", name, token);
-		}
+		if (!done)
+			error_msg_and_die("invalid system call '%s'", token);
 	}
 
 	free(copy);
 
-	if (!done) {
-		error_msg_and_die("invalid %s '%s'", name, str);
-	}
+	if (!done)
+		error_msg_and_die("invalid system call '%s'", str);
 }
 
 /*
@@ -273,7 +270,6 @@
 	 * of the remaining specification.
 	 */
 	const char *s = str;
-handle_inversion:
 	while (*s == '!') {
 		invert_number_set_array(set, 1);
 		++s;
@@ -287,8 +283,9 @@
 		 */
 		return;
 	} else if (strcmp(s, "all") == 0) {
-		s = "!none";
-		goto handle_inversion;
+		/* "all" == "!none" */
+		invert_number_set_array(set, 1);
+		return;
 	}
 
 	/*
@@ -300,22 +297,19 @@
 	 */
 	char *copy = xstrdup(s);
 	char *saveptr = NULL;
-	const char *token;
 	int number = -1;
 
-	for (token = strtok_r(copy, ",", &saveptr); token;
-	     token = strtok_r(NULL, ",", &saveptr)) {
+	for (const char *token = strtok_r(copy, ",", &saveptr);
+	     token; token = strtok_r(NULL, ",", &saveptr)) {
 		number = func(token);
-		if (number < 0) {
+		if (number < 0)
 			error_msg_and_die("invalid %s '%s'", name, token);
-		}
 
 		add_number_to_set(number, set);
 	}
 
 	free(copy);
 
-	if (number < 0) {
+	if (number < 0)
 		error_msg_and_die("invalid %s '%s'", name, str);
-	}
 }
diff --git a/bpf.c b/bpf.c
index 7734b07..59d1e74 100644
--- a/bpf.c
+++ b/bpf.c
@@ -90,7 +90,7 @@
 {
 	struct {
 		uint32_t map_type, key_size, value_size, max_entries,
-			 map_flags, inner_map_fd;
+			 map_flags, inner_map_fd, numa_node;
 	} attr = {};
 	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
 
@@ -103,6 +103,8 @@
 	PRINT_FIELD_U(", ", attr, max_entries);
 	PRINT_FIELD_FLAGS(", ", attr, map_flags, bpf_map_flags, "BPF_F_???");
 	PRINT_FIELD_FD(", ", attr, inner_map_fd, tcp);
+	if (attr.map_flags & BPF_F_NUMA_NODE)
+		PRINT_FIELD_U(", ", attr, numa_node);
 	decode_attr_extra_data(tcp, data, size, sizeof(attr));
 	tprints("}");
 
@@ -278,6 +280,105 @@
 	return RVAL_DECODED;
 }
 
+DEF_BPF_CMD_DECODER(BPF_PROG_TEST_RUN)
+{
+	struct {
+		uint32_t prog_fd, retval, data_size_in, data_size_out;
+		uint64_t ATTRIBUTE_ALIGNED(8) data_in, data_out;
+		uint32_t repeat, duration;
+	} attr = {};
+	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
+
+	memcpy(&attr, data, len);
+
+	PRINT_FIELD_FD("{test={", attr, prog_fd, tcp);
+	PRINT_FIELD_U(", ", attr, retval);
+	PRINT_FIELD_U(", ", attr, data_size_in);
+	PRINT_FIELD_U(", ", attr, data_size_out);
+	PRINT_FIELD_X(", ", attr, data_in);
+	PRINT_FIELD_X(", ", attr, data_out);
+	PRINT_FIELD_U(", ", attr, repeat);
+	PRINT_FIELD_U(", ", attr, duration);
+	tprints("}");
+	decode_attr_extra_data(tcp, data, size, sizeof(attr));
+	tprints("}");
+
+	return RVAL_DECODED;
+}
+
+DEF_BPF_CMD_DECODER(BPF_PROG_GET_NEXT_ID)
+{
+	struct {
+		uint32_t start_id, next_id;
+	} attr = {};
+	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
+
+	memcpy(&attr, data, len);
+
+	PRINT_FIELD_U("{", attr, start_id);
+	PRINT_FIELD_U(", ", attr, next_id);
+	decode_attr_extra_data(tcp, data, size, sizeof(attr));
+	tprints("}");
+
+	return RVAL_DECODED;
+}
+
+#define decode_BPF_MAP_GET_NEXT_ID decode_BPF_PROG_GET_NEXT_ID
+
+DEF_BPF_CMD_DECODER(BPF_PROG_GET_FD_BY_ID)
+{
+	struct {
+		uint32_t prog_id, next_id;
+	} attr = {};
+	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
+
+	memcpy(&attr, data, len);
+
+	PRINT_FIELD_U("{", attr, prog_id);
+	PRINT_FIELD_U(", ", attr, next_id);
+	decode_attr_extra_data(tcp, data, size, sizeof(attr));
+	tprints("}");
+
+	return RVAL_DECODED;
+}
+
+DEF_BPF_CMD_DECODER(BPF_MAP_GET_FD_BY_ID)
+{
+	struct {
+		uint32_t map_id, next_id;
+	} attr = {};
+	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
+
+	memcpy(&attr, data, len);
+
+	PRINT_FIELD_U("{", attr, map_id);
+	PRINT_FIELD_U(", ", attr, next_id);
+	decode_attr_extra_data(tcp, data, size, sizeof(attr));
+	tprints("}");
+
+	return RVAL_DECODED;
+}
+
+DEF_BPF_CMD_DECODER(BPF_OBJ_GET_INFO_BY_FD)
+{
+	struct {
+		uint32_t bpf_fd, info_len;
+		uint64_t ATTRIBUTE_ALIGNED(8) info;
+	} attr = {};
+	const unsigned int len = size < sizeof(attr) ? size : sizeof(attr);
+
+	memcpy(&attr, data, len);
+
+	PRINT_FIELD_FD("{info={", attr, bpf_fd, tcp);
+	PRINT_FIELD_U(", ", attr, info_len);
+	PRINT_FIELD_X(", ", attr, info);
+	tprints("}");
+	decode_attr_extra_data(tcp, data, size, sizeof(attr));
+	tprints("}");
+
+	return RVAL_DECODED | RVAL_FD;
+}
+
 SYS_FUNC(bpf)
 {
 	static const bpf_cmd_decoder_t bpf_cmd_decoders[] = {
@@ -291,6 +392,12 @@
 		BPF_CMD_ENTRY(BPF_OBJ_GET),
 		BPF_CMD_ENTRY(BPF_PROG_ATTACH),
 		BPF_CMD_ENTRY(BPF_PROG_DETACH),
+		BPF_CMD_ENTRY(BPF_PROG_TEST_RUN),
+		BPF_CMD_ENTRY(BPF_PROG_GET_NEXT_ID),
+		BPF_CMD_ENTRY(BPF_MAP_GET_NEXT_ID),
+		BPF_CMD_ENTRY(BPF_PROG_GET_FD_BY_ID),
+		BPF_CMD_ENTRY(BPF_MAP_GET_FD_BY_ID),
+		BPF_CMD_ENTRY(BPF_OBJ_GET_INFO_BY_FD),
 	};
 
 	const unsigned int cmd = tcp->u_arg[0];
diff --git a/btrfs.c b/btrfs.c
index 543acd7..ed3120a 100644
--- a/btrfs.c
+++ b/btrfs.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016 Jeff Mahoney <jeffm@suse.com>
- * Copyright (c) 2016-2017 The strace developers.
+ * Copyright (c) 2016-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -787,7 +787,7 @@
 		char uuid[UUID_STRING_SIZE+1];
 		uint32_t nodesize, sectorsize, clone_alignment;
 #ifndef HAVE_STRUCT_BTRFS_IOCTL_FS_INFO_ARGS_NODESIZE
-		__u32 *reserved32;
+		uint32_t *reserved32;
 #endif
 
 		if (entering(tcp))
@@ -802,7 +802,7 @@
 		sectorsize = args.sectorsize,
 		clone_alignment = args.clone_alignment;
 #else
-		reserved32 = (__u32 *) (void *) args.reserved;
+		reserved32 = (void *) args.reserved;
 		nodesize = reserved32[0];
 		sectorsize = reserved32[1];
 		clone_alignment = reserved32[2];
diff --git a/clone.c b/clone.c
index a5f2b24..e1dcd71 100644
--- a/clone.c
+++ b/clone.c
@@ -4,7 +4,7 @@
  * Copyright (c) 2008 Jan Kratochvil <jan.kratochvil@redhat.com>
  * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
  * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2014-2017 The strace developers.
+ * Copyright (c) 2014-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@
 # define ARG_PTID	(tcp->scno == __NR_clone2 ? 3 : 2)
 # define ARG_CTID	(tcp->scno == __NR_clone2 ? 4 : 3)
 # define ARG_TLS	(tcp->scno == __NR_clone2 ? 5 : 4)
-#elif defined S390 || defined S390X || defined CRISV10 || defined CRISV32
+#elif defined S390 || defined S390X
 # define ARG_STACK	0
 # define ARG_FLAGS	1
 # define ARG_PTID	2
@@ -84,7 +84,7 @@
 	if (current_personality == 1)
 # endif
 	{
-		print_user_desc(tcp, tcp->u_arg[ARG_TLS]);
+		print_user_desc(tcp, tcp->u_arg[ARG_TLS], USER_DESC_BOTH);
 	}
 # if SUPPORTED_PERSONALITIES > 1
 	else
diff --git a/config.h b/config.h
index a1709ad..0f71839 100644
--- a/config.h
+++ b/config.h
@@ -26,13 +26,7 @@
 /* #undef BFIN */
 
 /* Current copyright year. */
-#define COPYRIGHT_YEAR "2017"
-
-/* Define for the CRISv10 architecture. */
-/* #undef CRISV10 */
-
-/* Define for the CRISv32 architecture. */
-/* #undef CRISV32 */
+#define COPYRIGHT_YEAR "2018"
 
 /* Define to 1 if you want OABI support on ARM EABI. */
 #define ENABLE_ARM_OABI 0
@@ -43,6 +37,9 @@
 /* Define to 1 if you have the <asm/cachectl.h> header file. */
 /* #undef HAVE_ASM_CACHECTL_H */
 
+/* Define to 1 if you have the <asm/guarded_storage.h> header file. */
+/* #undef HAVE_ASM_GUARDED_STORAGE_H */
+
 /* Define to 1 if you have the <asm/sigcontext.h> header file. */
 #define HAVE_ASM_SIGCONTEXT_H 1
 
@@ -646,6 +643,9 @@
    0 if you don't. */
 #define HAVE_DECL_VM_VFS_CACHE_PRESSURE 1
 
+/* Define to 1 if you have the <demangle.h> header file. */
+/* #undef HAVE_DEMANGLE_H */
+
 /* Define to 1 if the system provides dladdr */
 #define HAVE_DLADDR 1
 
@@ -685,12 +685,21 @@
 /* Define to 1 if you have the <gnu/stubs-x32.h> header file. */
 /* #undef HAVE_GNU_STUBS_X32_H */
 
+/* Define to 1 if you have the <iconv.h> header file. */
+/* #undef HAVE_ICONV_H */
+
+/* Define to 1 if you have the `iconv_open' function. */
+/* #undef HAVE_ICONV_OPEN */
+
 /* Define to 1 if you have the `if_indextoname' function. */
 #define HAVE_IF_INDEXTONAME 1
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #define HAVE_INTTYPES_H 1
 
+/* Define to 1 if you have the <libiberty/demangle.h> header file. */
+/* #undef HAVE_LIBIBERTY_DEMANGLE_H */
+
 /* Define to 1 if you have the <libunwind-ptrace.h> header file. */
 /* #undef HAVE_LIBUNWIND_PTRACE_H */
 
@@ -745,6 +754,12 @@
 /* Define to 1 if you have the <linux/kcmp.h> header file. */
 #define HAVE_LINUX_KCMP_H 1
 
+/* Define to 1 if you have the <linux/kvm.h> header file. */
+#define HAVE_LINUX_KVM_H 1
+
+/* Define to 1 if you have the <linux/memfd.h> header file. */
+#define HAVE_LINUX_MEMFD_H 1
+
 /* Define to 1 if you have the <linux/mmtimer.h> header file. */
 #define HAVE_LINUX_MMTIMER_H 1
 
@@ -841,7 +856,7 @@
 /* Define to 1 if you have the <linux/utsname.h> header file. */
 #define HAVE_LINUX_UTSNAME_H 1
 
-/* Define to 1 if you have CFLAG mpers support */
+/* Define to 1 if you have mpers_name mpers support */
 /* #undef HAVE_M32_MPERS */
 
 /* Define to 1 if MPERS_NAME has the type 'struct stat'. */
@@ -863,7 +878,7 @@
 /* Define to 1 if you have the <mqueue.h> header file. */
 /* #undef HAVE_MQUEUE_H */
 
-/* Define to 1 if you have CFLAG mpers support */
+/* Define to 1 if you have mpers_name mpers support */
 /* #undef HAVE_MX32_MPERS */
 
 /* Define to 1 if MPERS_NAME has the type 'struct stat'. */
@@ -894,6 +909,9 @@
 /* Define to 1 if you have the `open64' function. */
 #define HAVE_OPEN64 1
 
+/* Define to 1 if you have the <paths.h> header file. */
+#define HAVE_PATHS_H 1
+
 /* Define to 1 if you have the `prctl' function. */
 #define HAVE_PRCTL 1
 
@@ -1048,9 +1066,22 @@
 /* Define to 1 if the system has the type `struct keyctl_kdf_params'. */
 #define HAVE_STRUCT_KEYCTL_KDF_PARAMS 1
 
+/* Define to 1 if the system has the type `struct kvm_regs'. */
+#define HAVE_STRUCT_KVM_REGS 1
+
+/* Define to 1 if the system has the type `struct kvm_sregs'. */
+#define HAVE_STRUCT_KVM_SREGS 1
+
+/* Define to 1 if the system has the type `struct
+   kvm_userspace_memory_region'. */
+#define HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION 1
+
 /* Define to 1 if the system has the type `struct mmsghdr'. */
 #define HAVE_STRUCT_MMSGHDR 1
 
+/* Define to 1 if the system has the type `struct mtd_write_req'. */
+#define HAVE_STRUCT_MTD_WRITE_REQ 1
+
 /* Define to 1 if the system has the type `struct ndt_config'. */
 #define HAVE_STRUCT_NDT_CONFIG 1
 
@@ -1105,6 +1136,9 @@
 /* Define to 1 if `mmap_data' is a member of `struct perf_event_attr'. */
 #define HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA 1
 
+/* Define to 1 if `namespaces' is a member of `struct perf_event_attr'. */
+#define HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES 1
+
 /* Define to 1 if `precise_ip' is a member of `struct perf_event_attr'. */
 #define HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP 1
 
@@ -1133,6 +1167,9 @@
 /* Define to 1 if `write_backward' is a member of `struct perf_event_attr'. */
 #define HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD 1
 
+/* Define to 1 if the system has the type `struct ptp_sys_offset'. */
+#define HAVE_STRUCT_PTP_SYS_OFFSET 1
+
 /* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */
 #define HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS 1
 
@@ -1202,9 +1239,15 @@
 /* Define to 1 if `tai' is a member of `struct timex'. */
 #define HAVE_STRUCT_TIMEX_TAI 1
 
+/* Define to 1 if `max_beb_per1024' is a member of `struct ubi_attach_req'. */
+/* #undef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 */
+
 /* Define to 1 if the system has the type `struct user_desc'. */
 /* #undef HAVE_STRUCT_USER_DESC */
 
+/* Define to 1 if `lm' is a member of `struct user_desc'. */
+/* #undef HAVE_STRUCT_USER_DESC_LM */
+
 /* Define to 1 if `domainname' is a member of `struct utsname'. */
 #define HAVE_STRUCT_UTSNAME_DOMAINNAME 1
 
@@ -1268,21 +1311,30 @@
 /* Define to 1 if typeof works with your compiler. */
 #define HAVE_TYPEOF 1
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `attach_flags' is a member of `union bpf_attr'. */
 #define HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 1
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `bpf_fd' is a member of `union bpf_attr'. */
 #define HAVE_UNION_BPF_ATTR_BPF_FD 1
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `flags' is a member of `union bpf_attr'. */
 #define HAVE_UNION_BPF_ATTR_FLAGS 1
 
-/* Define to 1 if attr_text initialization works */
-#define HAVE_UNION_BPF_ATTR_INNER_MAP_FD 1
+/* Define to 1 if `info.info' is a member of `union bpf_attr'. */
+/* #undef HAVE_UNION_BPF_ATTR_INFO_INFO */
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `next_id' is a member of `union bpf_attr'. */
+/* #undef HAVE_UNION_BPF_ATTR_NEXT_ID */
+
+/* Define to 1 if `numa_node' is a member of `union bpf_attr'. */
+/* #undef HAVE_UNION_BPF_ATTR_NUMA_NODE */
+
+/* Define to 1 if `prog_flags' is a member of `union bpf_attr'. */
 #define HAVE_UNION_BPF_ATTR_PROG_FLAGS 1
 
+/* Define to 1 if `test.duration' is a member of `union bpf_attr'. */
+#define HAVE_UNION_BPF_ATTR_TEST_DURATION 1
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #define HAVE_UNISTD_H 1
 
@@ -1329,7 +1381,7 @@
 /* #undef M68K */
 
 /* Date */
-#define MANPAGE_DATE "2017-08-28"
+#define MANPAGE_DATE "2018-02-11"
 
 /* Define for the Meta architecture. */
 /* #undef METAG */
@@ -1362,7 +1414,7 @@
 #define PACKAGE_NAME "strace"
 
 /* Define to the full name and version of this package. */
-#define PACKAGE_STRING "strace 4.20"
+#define PACKAGE_STRING "strace 4.21"
 
 /* Define to the one symbol short name of this package. */
 #define PACKAGE_TARNAME "strace"
@@ -1371,7 +1423,7 @@
 #define PACKAGE_URL "https://strace.io"
 
 /* Define to the version of this package. */
-#define PACKAGE_VERSION "4.20"
+#define PACKAGE_VERSION "4.21"
 
 /* Define for the PowerPC architecture. */
 /* #undef POWERPC */
@@ -1417,6 +1469,9 @@
 /* Define for the Tile architecture */
 /* #undef TILE */
 
+/* Do demangling symbols in stack trace */
+/* #undef USE_DEMANGLE */
+
 /* Compile stack tracing functionality */
 /* #undef USE_LIBUNWIND */
 
@@ -1443,7 +1498,7 @@
 
 
 /* Version number of package */
-#define VERSION "4.20"
+#define VERSION "4.21"
 
 /* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
    significant byte first (like Motorola and SPARC, unlike Intel). */
diff --git a/config.h.in b/config.h.in
index 77a7335..1fd4ab8 100644
--- a/config.h.in
+++ b/config.h.in
@@ -30,12 +30,6 @@
 /* Current copyright year. */
 #undef COPYRIGHT_YEAR
 
-/* Define for the CRISv10 architecture. */
-#undef CRISV10
-
-/* Define for the CRISv32 architecture. */
-#undef CRISV32
-
 /* Define to 1 if you want OABI support on ARM EABI. */
 #undef ENABLE_ARM_OABI
 
@@ -45,6 +39,9 @@
 /* Define to 1 if you have the <asm/cachectl.h> header file. */
 #undef HAVE_ASM_CACHECTL_H
 
+/* Define to 1 if you have the <asm/guarded_storage.h> header file. */
+#undef HAVE_ASM_GUARDED_STORAGE_H
+
 /* Define to 1 if you have the <asm/sigcontext.h> header file. */
 #undef HAVE_ASM_SIGCONTEXT_H
 
@@ -648,6 +645,9 @@
    0 if you don't. */
 #undef HAVE_DECL_VM_VFS_CACHE_PRESSURE
 
+/* Define to 1 if you have the <demangle.h> header file. */
+#undef HAVE_DEMANGLE_H
+
 /* Define to 1 if the system provides dladdr */
 #undef HAVE_DLADDR
 
@@ -687,12 +687,21 @@
 /* Define to 1 if you have the <gnu/stubs-x32.h> header file. */
 #undef HAVE_GNU_STUBS_X32_H
 
+/* Define to 1 if you have the <iconv.h> header file. */
+#undef HAVE_ICONV_H
+
+/* Define to 1 if you have the `iconv_open' function. */
+#undef HAVE_ICONV_OPEN
+
 /* Define to 1 if you have the `if_indextoname' function. */
 #undef HAVE_IF_INDEXTONAME
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
 
+/* Define to 1 if you have the <libiberty/demangle.h> header file. */
+#undef HAVE_LIBIBERTY_DEMANGLE_H
+
 /* Define to 1 if you have the <libunwind-ptrace.h> header file. */
 #undef HAVE_LIBUNWIND_PTRACE_H
 
@@ -747,6 +756,12 @@
 /* Define to 1 if you have the <linux/kcmp.h> header file. */
 #undef HAVE_LINUX_KCMP_H
 
+/* Define to 1 if you have the <linux/kvm.h> header file. */
+#undef HAVE_LINUX_KVM_H
+
+/* Define to 1 if you have the <linux/memfd.h> header file. */
+#undef HAVE_LINUX_MEMFD_H
+
 /* Define to 1 if you have the <linux/mmtimer.h> header file. */
 #undef HAVE_LINUX_MMTIMER_H
 
@@ -843,7 +858,7 @@
 /* Define to 1 if you have the <linux/utsname.h> header file. */
 #undef HAVE_LINUX_UTSNAME_H
 
-/* Define to 1 if you have CFLAG mpers support */
+/* Define to 1 if you have mpers_name mpers support */
 #undef HAVE_M32_MPERS
 
 /* Define to 1 if MPERS_NAME has the type 'struct stat'. */
@@ -865,7 +880,7 @@
 /* Define to 1 if you have the <mqueue.h> header file. */
 #undef HAVE_MQUEUE_H
 
-/* Define to 1 if you have CFLAG mpers support */
+/* Define to 1 if you have mpers_name mpers support */
 #undef HAVE_MX32_MPERS
 
 /* Define to 1 if MPERS_NAME has the type 'struct stat'. */
@@ -896,6 +911,9 @@
 /* Define to 1 if you have the `open64' function. */
 #undef HAVE_OPEN64
 
+/* Define to 1 if you have the <paths.h> header file. */
+#undef HAVE_PATHS_H
+
 /* Define to 1 if you have the `prctl' function. */
 #undef HAVE_PRCTL
 
@@ -1050,9 +1068,22 @@
 /* Define to 1 if the system has the type `struct keyctl_kdf_params'. */
 #undef HAVE_STRUCT_KEYCTL_KDF_PARAMS
 
+/* Define to 1 if the system has the type `struct kvm_regs'. */
+#undef HAVE_STRUCT_KVM_REGS
+
+/* Define to 1 if the system has the type `struct kvm_sregs'. */
+#undef HAVE_STRUCT_KVM_SREGS
+
+/* Define to 1 if the system has the type `struct
+   kvm_userspace_memory_region'. */
+#undef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION
+
 /* Define to 1 if the system has the type `struct mmsghdr'. */
 #undef HAVE_STRUCT_MMSGHDR
 
+/* Define to 1 if the system has the type `struct mtd_write_req'. */
+#undef HAVE_STRUCT_MTD_WRITE_REQ
+
 /* Define to 1 if the system has the type `struct ndt_config'. */
 #undef HAVE_STRUCT_NDT_CONFIG
 
@@ -1107,6 +1138,9 @@
 /* Define to 1 if `mmap_data' is a member of `struct perf_event_attr'. */
 #undef HAVE_STRUCT_PERF_EVENT_ATTR_MMAP_DATA
 
+/* Define to 1 if `namespaces' is a member of `struct perf_event_attr'. */
+#undef HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES
+
 /* Define to 1 if `precise_ip' is a member of `struct perf_event_attr'. */
 #undef HAVE_STRUCT_PERF_EVENT_ATTR_PRECISE_IP
 
@@ -1135,6 +1169,9 @@
 /* Define to 1 if `write_backward' is a member of `struct perf_event_attr'. */
 #undef HAVE_STRUCT_PERF_EVENT_ATTR_WRITE_BACKWARD
 
+/* Define to 1 if the system has the type `struct ptp_sys_offset'. */
+#undef HAVE_STRUCT_PTP_SYS_OFFSET
+
 /* Define to 1 if the system has the type `struct ptrace_peeksiginfo_args'. */
 #undef HAVE_STRUCT_PTRACE_PEEKSIGINFO_ARGS
 
@@ -1204,9 +1241,15 @@
 /* Define to 1 if `tai' is a member of `struct timex'. */
 #undef HAVE_STRUCT_TIMEX_TAI
 
+/* Define to 1 if `max_beb_per1024' is a member of `struct ubi_attach_req'. */
+#undef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
+
 /* Define to 1 if the system has the type `struct user_desc'. */
 #undef HAVE_STRUCT_USER_DESC
 
+/* Define to 1 if `lm' is a member of `struct user_desc'. */
+#undef HAVE_STRUCT_USER_DESC_LM
+
 /* Define to 1 if `domainname' is a member of `struct utsname'. */
 #undef HAVE_STRUCT_UTSNAME_DOMAINNAME
 
@@ -1270,21 +1313,30 @@
 /* Define to 1 if typeof works with your compiler. */
 #undef HAVE_TYPEOF
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `attach_flags' is a member of `union bpf_attr'. */
 #undef HAVE_UNION_BPF_ATTR_ATTACH_FLAGS
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `bpf_fd' is a member of `union bpf_attr'. */
 #undef HAVE_UNION_BPF_ATTR_BPF_FD
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `flags' is a member of `union bpf_attr'. */
 #undef HAVE_UNION_BPF_ATTR_FLAGS
 
-/* Define to 1 if attr_text initialization works */
-#undef HAVE_UNION_BPF_ATTR_INNER_MAP_FD
+/* Define to 1 if `info.info' is a member of `union bpf_attr'. */
+#undef HAVE_UNION_BPF_ATTR_INFO_INFO
 
-/* Define to 1 if attr_text initialization works */
+/* Define to 1 if `next_id' is a member of `union bpf_attr'. */
+#undef HAVE_UNION_BPF_ATTR_NEXT_ID
+
+/* Define to 1 if `numa_node' is a member of `union bpf_attr'. */
+#undef HAVE_UNION_BPF_ATTR_NUMA_NODE
+
+/* Define to 1 if `prog_flags' is a member of `union bpf_attr'. */
 #undef HAVE_UNION_BPF_ATTR_PROG_FLAGS
 
+/* Define to 1 if `test.duration' is a member of `union bpf_attr'. */
+#undef HAVE_UNION_BPF_ATTR_TEST_DURATION
+
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
@@ -1423,6 +1475,9 @@
 /* Define for the Tile architecture */
 #undef TILE
 
+/* Do demangling symbols in stack trace */
+#undef USE_DEMANGLE
+
 /* Compile stack tracing functionality */
 #undef USE_LIBUNWIND
 
diff --git a/configure b/configure
index c971736..42f5130 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for strace 4.20.
+# Generated by GNU Autoconf 2.69 for strace 4.21.
 #
 # Report bugs to <strace-devel@lists.sourceforge.net>.
 #
@@ -11,7 +11,7 @@
 # This configure script is free software; the Free Software Foundation
 # gives unlimited permission to copy, distribute and modify it.
 #
-# Copyright (c) 1999-2017 The strace developers.
+# Copyright (c) 1999-2018 The strace developers.
 ## -------------------- ##
 ## M4sh Initialization. ##
 ## -------------------- ##
@@ -582,8 +582,8 @@
 # Identity of this package.
 PACKAGE_NAME='strace'
 PACKAGE_TARNAME='strace'
-PACKAGE_VERSION='4.20'
-PACKAGE_STRING='strace 4.20'
+PACKAGE_VERSION='4.21'
+PACKAGE_STRING='strace 4.21'
 PACKAGE_BUGREPORT='strace-devel@lists.sourceforge.net'
 PACKAGE_URL='https://strace.io'
 
@@ -647,14 +647,25 @@
 HAVE_M32_MPERS_TRUE
 HAVE_M32_RUNTIME_FALSE
 HAVE_M32_RUNTIME_TRUE
+USE_DEMANGLE_FALSE
+USE_DEMANGLE_TRUE
+libiberty_CPPFLAGS
+libiberty_LDFLAGS
+libiberty_LIBS
 USE_LIBUNWIND_FALSE
 USE_LIBUNWIND_TRUE
 libunwind_CPPFLAGS
 libunwind_LDFLAGS
 libunwind_LIBS
+READELF
 PERL
 dl_LIBS
+SIZEOF_KERNEL_LONG_T
+SIZEOF_LONG
 MIPS_ABI
+arch_native
+cc_flags_mx32
+cc_flags_m32
 arch_mx32
 arch_m32
 arch
@@ -793,6 +804,8 @@
 enable_code_coverage
 enable_arm_oabi
 with_libunwind
+with_libiberty
+enable_mpers
 enable_valgrind
 enable_valgrind_memcheck
 enable_valgrind_helgrind
@@ -1348,7 +1361,7 @@
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures strace 4.20 to adapt to many kinds of systems.
+\`configure' configures strace 4.21 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1418,7 +1431,7 @@
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of strace 4.20:";;
+     short | recursive ) echo "Configuration of strace 4.21:";;
    esac
   cat <<\_ACEOF
 
@@ -1438,6 +1451,11 @@
   --enable-gcc-Werror     turn on gcc's -Werror option
   --enable-code-coverage  Whether to enable code coverage support
   --enable-arm-oabi       enable OABI support on ARM EABI
+  --enable-mpers=yes|no|check|m32|mx32
+                          whether to enable multiple personalities support
+                          required for proper decoding of structures used by
+                          tracees with personalities that differ from the
+                          personality of strace, default is yes.
   --enable-valgrind       Whether to enable Valgrind on the unit tests
   --disable-valgrind-memcheck
                           Whether to skip memcheck during the Valgrind tests
@@ -1452,6 +1470,7 @@
   --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
   --with-gcov=GCOV        use given GCOV for coverage (GCOV=gcov).
   --with-libunwind        use libunwind to implement stack tracing support
+  --with-libiberty        use libiberty to demangle symbols in stack trace
 
 Some influential environment variables:
   CC          C compiler command
@@ -1530,14 +1549,14 @@
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-strace configure 4.20
+strace configure 4.21
 generated by GNU Autoconf 2.69
 
 Copyright (C) 2012 Free Software Foundation, Inc.
 This configure script is free software; the Free Software Foundation
 gives unlimited permission to copy, distribute and modify it.
 
-Copyright (c) 1999-2017 The strace developers.
+Copyright (c) 1999-2018 The strace developers.
 _ACEOF
   exit
 fi
@@ -2270,7 +2289,7 @@
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by strace $as_me 4.20, which was
+It was created by strace $as_me 4.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   $ $0 $@
@@ -3141,7 +3160,7 @@
 
 # Define the identity of the package.
  PACKAGE='strace'
- VERSION='4.20'
+ VERSION='4.21'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -4372,6 +4391,298 @@
 fi
 
 
+   case $ac_cv_prog_cc_stdc in #(
+  no) :
+    ac_cv_prog_cc_c99=no; ac_cv_prog_cc_c89=no ;; #(
+  *) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C99" >&5
+$as_echo_n "checking for $CC option to accept ISO C99... " >&6; }
+if ${ac_cv_prog_cc_c99+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c99=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdbool.h>
+#include <stdlib.h>
+#include <wchar.h>
+#include <stdio.h>
+
+// Check varargs macros.  These examples are taken from C99 6.10.3.5.
+#define debug(...) fprintf (stderr, __VA_ARGS__)
+#define showlist(...) puts (#__VA_ARGS__)
+#define report(test,...) ((test) ? puts (#test) : printf (__VA_ARGS__))
+static void
+test_varargs_macros (void)
+{
+  int x = 1234;
+  int y = 5678;
+  debug ("Flag");
+  debug ("X = %d\n", x);
+  showlist (The first, second, and third items.);
+  report (x>y, "x is %d but y is %d", x, y);
+}
+
+// Check long long types.
+#define BIG64 18446744073709551615ull
+#define BIG32 4294967295ul
+#define BIG_OK (BIG64 / BIG32 == 4294967297ull && BIG64 % BIG32 == 0)
+#if !BIG_OK
+  your preprocessor is broken;
+#endif
+#if BIG_OK
+#else
+  your preprocessor is broken;
+#endif
+static long long int bignum = -9223372036854775807LL;
+static unsigned long long int ubignum = BIG64;
+
+struct incomplete_array
+{
+  int datasize;
+  double data[];
+};
+
+struct named_init {
+  int number;
+  const wchar_t *name;
+  double average;
+};
+
+typedef const char *ccp;
+
+static inline int
+test_restrict (ccp restrict text)
+{
+  // See if C++-style comments work.
+  // Iterate through items via the restricted pointer.
+  // Also check for declarations in for loops.
+  for (unsigned int i = 0; *(text+i) != '\0'; ++i)
+    continue;
+  return 0;
+}
+
+// Check varargs and va_copy.
+static void
+test_varargs (const char *format, ...)
+{
+  va_list args;
+  va_start (args, format);
+  va_list args_copy;
+  va_copy (args_copy, args);
+
+  const char *str;
+  int number;
+  float fnumber;
+
+  while (*format)
+    {
+      switch (*format++)
+	{
+	case 's': // string
+	  str = va_arg (args_copy, const char *);
+	  break;
+	case 'd': // int
+	  number = va_arg (args_copy, int);
+	  break;
+	case 'f': // float
+	  fnumber = va_arg (args_copy, double);
+	  break;
+	default:
+	  break;
+	}
+    }
+  va_end (args_copy);
+  va_end (args);
+}
+
+int
+main ()
+{
+
+  // Check bool.
+  _Bool success = false;
+
+  // Check restrict.
+  if (test_restrict ("String literal") == 0)
+    success = true;
+  char *restrict newvar = "Another string";
+
+  // Check varargs.
+  test_varargs ("s, d' f .", "string", 65, 34.234);
+  test_varargs_macros ();
+
+  // Check flexible array members.
+  struct incomplete_array *ia =
+    malloc (sizeof (struct incomplete_array) + (sizeof (double) * 10));
+  ia->datasize = 10;
+  for (int i = 0; i < ia->datasize; ++i)
+    ia->data[i] = i * 1.234;
+
+  // Check named initializers.
+  struct named_init ni = {
+    .number = 34,
+    .name = L"Test wide string",
+    .average = 543.34343,
+  };
+
+  ni.number = 58;
+
+  int dynamic_array[ni.number];
+  dynamic_array[ni.number - 1] = 543;
+
+  // work around unused variable warnings
+  return (!success || bignum == 0LL || ubignum == 0uLL || newvar[0] == 'x'
+	  || dynamic_array[ni.number - 1] != 543);
+
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -std=gnu99 -std=c99 -c99 -AC99 -D_STDC_C99= -qlanglvl=extc99
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c99=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c99" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c99" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c99"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c99" >&5
+$as_echo "$ac_cv_prog_cc_c99" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c99" != xno; then :
+  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c99
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+  ac_cv_prog_cc_stdc=$ac_cv_prog_cc_c89
+else
+  ac_cv_prog_cc_stdc=no
+fi
+
+fi
+ ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO Standard C" >&5
+$as_echo_n "checking for $CC option to accept ISO Standard C... " >&6; }
+  if ${ac_cv_prog_cc_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+
+  case $ac_cv_prog_cc_stdc in #(
+  no) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;; #(
+  '') :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;; #(
+  *) :
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_stdc" >&5
+$as_echo "$ac_cv_prog_cc_stdc" >&6; } ;;
+esac
+
 ac_ext=c
 ac_cpp='$CPP $CPPFLAGS'
 ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -8510,28 +8821,67 @@
 
 
 
-$as_echo "#define COPYRIGHT_YEAR \"2017\"" >>confdefs.h
+$as_echo "#define COPYRIGHT_YEAR \"2018\"" >>confdefs.h
 
-COPYRIGHT_YEAR=2017
+COPYRIGHT_YEAR=2018
 
 
 
-$as_echo "#define MANPAGE_DATE \"2017-08-28\"" >>confdefs.h
+$as_echo "#define MANPAGE_DATE \"2018-02-11\"" >>confdefs.h
 
-MANPAGE_DATE=2017-08-28
+MANPAGE_DATE=2018-02-11
 
 
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for supported architecture" >&5
 $as_echo_n "checking for supported architecture... " >&6; }
 arch_m32=
 arch_mx32=
+cc_flags_m32=-m32
+cc_flags_mx32=-mx32
 case "$host_cpu" in
+aarch64*)
+	arch=aarch64
+	arch_m32=arm
+
+$as_echo "#define AARCH64 1" >>confdefs.h
+
+	;;
+alpha*)
+	arch=alpha
+
+$as_echo "#define ALPHA 1" >>confdefs.h
+
+	;;
+arc*)
+	arch=arc
+
+$as_echo "#define ARC 1" >>confdefs.h
+
+	;;
+arm*)
+	arch=arm
+
+$as_echo "#define ARM 1" >>confdefs.h
+
+	;;
+avr32*)
+	arch=avr32
+
+$as_echo "#define AVR32 1" >>confdefs.h
+
+	;;
 bfin)
 	arch=bfin
 
 $as_echo "#define BFIN 1" >>confdefs.h
 
 	;;
+hppa*|parisc*)
+	arch=hppa
+
+$as_echo "#define HPPA 1" >>confdefs.h
+
+	;;
 i[3456]86|pentium)
 	arch=i386
 
@@ -8550,35 +8900,34 @@
 $as_echo "#define M68K 1" >>confdefs.h
 
 	;;
-sparc64*)
-	arch=sparc64
-	arch_m32=sparc
-
-$as_echo "#define SPARC64 1" >>confdefs.h
-
-	;;
-sparc*)
-	arch=sparc
-
-$as_echo "#define SPARC 1" >>confdefs.h
-
-	;;
 metag*)
 	arch=metag
 
 $as_echo "#define METAG 1" >>confdefs.h
 
 	;;
+microblaze*)
+	arch=microblaze
+
+$as_echo "#define MICROBLAZE 1" >>confdefs.h
+
+	;;
 mips*)
 	arch=mips
 
 $as_echo "#define MIPS 1" >>confdefs.h
 
 	;;
-alpha*)
-	arch=alpha
+nios2*)
+	arch=nios2
 
-$as_echo "#define ALPHA 1" >>confdefs.h
+$as_echo "#define NIOS2 1" >>confdefs.h
+
+	;;
+or1k*)
+	arch=or1k
+
+$as_echo "#define OR1K 1" >>confdefs.h
 
 	;;
 powerpc*)
@@ -8611,29 +8960,10 @@
 
 	fi
 	;;
-arm*)
-	arch=arm
+riscv*)
+	arch=riscv
 
-$as_echo "#define ARM 1" >>confdefs.h
-
-	;;
-aarch64*)
-	arch=aarch64
-	arch_m32=arm
-
-$as_echo "#define AARCH64 1" >>confdefs.h
-
-	;;
-avr32*)
-	arch=avr32
-
-$as_echo "#define AVR32 1" >>confdefs.h
-
-	;;
-arc*)
-	arch=arc
-
-$as_echo "#define ARC 1" >>confdefs.h
+$as_echo "#define RISCV 1" >>confdefs.h
 
 	;;
 s390)
@@ -8644,16 +8974,12 @@
 	;;
 s390x)
 	arch=s390x
+	arch_m32=s390
+	cc_flags_m32=-m31
 
 $as_echo "#define S390X 1" >>confdefs.h
 
 	;;
-hppa*|parisc*)
-	arch=hppa
-
-$as_echo "#define HPPA 1" >>confdefs.h
-
-	;;
 sh64*)
 	arch=sh64
 
@@ -8666,6 +8992,25 @@
 $as_echo "#define SH 1" >>confdefs.h
 
 	;;
+sparc64*)
+	arch=sparc64
+	arch_m32=sparc
+
+$as_echo "#define SPARC64 1" >>confdefs.h
+
+	;;
+sparc*)
+	arch=sparc
+
+$as_echo "#define SPARC 1" >>confdefs.h
+
+	;;
+tile*)
+	arch=tile
+
+$as_echo "#define TILE 1" >>confdefs.h
+
+	;;
 x86?64*)
 	arch_m32=i386
 	cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -8698,58 +9043,12 @@
 
 	fi
 	;;
-cris|crisv10)
-	arch=crisv10
-
-$as_echo "#define CRISV10 1" >>confdefs.h
-
-	;;
-crisv32)
-	arch=crisv32
-
-$as_echo "#define CRISV32 1" >>confdefs.h
-
-	;;
-tile*)
-	arch=tile
-
-$as_echo "#define TILE 1" >>confdefs.h
-
-	;;
-microblaze*)
-	arch=microblaze
-
-$as_echo "#define MICROBLAZE 1" >>confdefs.h
-
-	;;
-nios2*)
-	arch=nios2
-
-$as_echo "#define NIOS2 1" >>confdefs.h
-
-	;;
-
-or1k*)
-	arch=or1k
-
-$as_echo "#define OR1K 1" >>confdefs.h
-
-	;;
-
 xtensa*)
 	arch=xtensa
 
 $as_echo "#define XTENSA 1" >>confdefs.h
 
 	;;
-
-riscv*)
-	arch=riscv
-
-$as_echo "#define RISCV 1" >>confdefs.h
-
-	;;
-
 *)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: NO!" >&5
 $as_echo "NO!" >&6; }
@@ -8759,6 +9058,8 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $arch" >&5
 $as_echo "$arch" >&6; }
 
+arch_native=$arch
+
 test -n "$arch_m32" ||
 	arch_m32=$arch
 test -n "$arch_mx32" ||
@@ -8767,6 +9068,9 @@
 
 
 
+
+
+
 MIPS_ABI=
 if test "$arch" = mips; then
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for _MIPS_SIM" >&5
@@ -8777,7 +9081,10 @@
   if ac_fn_c_compute_int "$LINENO" "_MIPS_SIM" "st_cv__MIPS_SIM"        ""; then :
 
 else
-  as_fn_error $? "_MIPS_SIM cannot be determined" "$LINENO" 5
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "_MIPS_SIM cannot be determined
+See \`config.log' for more details" "$LINENO" 5; }
 fi
 
 fi
@@ -9187,7 +9494,7 @@
 fi
 
 
-for ac_func in accept4 be64toh fallocate fanotify_mark fopen64 fork fputs_unlocked fstatat ftruncate futimens if_indextoname open64 prctl preadv process_vm_readv pwritev readahead signalfd stpcpy strerror strndup strsignal sync_file_range utimensat
+for ac_func in accept4 be64toh fallocate fanotify_mark fopen64 fork fputs_unlocked fstatat ftruncate futimens iconv_open if_indextoname open64 prctl preadv process_vm_readv pwritev readahead signalfd stpcpy strerror strndup strsignal sync_file_range utimensat
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@@ -9288,6 +9595,16 @@
 #define HAVE_STRUCT_USER_DESC 1
 _ACEOF
 
+ac_fn_c_check_member "$LINENO" "struct user_desc" "lm" "ac_cv_member_struct_user_desc_lm" "#include <asm/ldt.h>
+"
+if test "x$ac_cv_member_struct_user_desc_lm" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_USER_DESC_LM 1
+_ACEOF
+
+
+fi
 
 fi
 
@@ -9646,6 +9963,16 @@
 
 
 fi
+ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "namespaces" "ac_cv_member_struct_perf_event_attr_namespaces" "#include <linux/perf_event.h>
+"
+if test "x$ac_cv_member_struct_perf_event_attr_namespaces" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_PERF_EVENT_ATTR_NAMESPACES 1
+_ACEOF
+
+
+fi
 ac_fn_c_check_member "$LINENO" "struct perf_event_attr" "bp_type" "ac_cv_member_struct_perf_event_attr_bp_type" "#include <linux/perf_event.h>
 "
 if test "x$ac_cv_member_struct_perf_event_attr_bp_type" = xyes; then :
@@ -9738,7 +10065,7 @@
 fi
 
 
-for ac_header in asm/cachectl.h asm/sysmips.h bluetooth/bluetooth.h elf.h inttypes.h linux/bsg.h linux/cryptouser.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h linux/fib_rules.h linux/fiemap.h linux/genetlink.h linux/hiddev.h linux/if_addr.h linux/if_link.h linux/ip_vs.h linux/ipc.h linux/kcmp.h linux/mmtimer.h linux/msg.h linux/neighbour.h linux/netfilter/ipset/ip_set.h linux/netfilter/nf_tables.h linux/netfilter/nf_tables_compat.h linux/netfilter/nfnetlink.h linux/netfilter/nfnetlink_acct.h linux/netfilter/nfnetlink_conntrack.h linux/netfilter/nfnetlink_cthelper.h linux/netfilter/nfnetlink_cttimeout.h linux/netfilter/nfnetlink_log.h linux/netfilter/nfnetlink_queue.h linux/nsfs.h linux/perf_event.h linux/quota.h linux/seccomp.h linux/securebits.h linux/sem.h linux/shm.h linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h netipx/ipx.h scsi/sg.h stropts.h sys/conf.h sys/eventfd.h sys/fanotify.h sys/ipc.h sys/msg.h sys/quota.h sys/reg.h sys/sem.h sys/shm.h sys/signalfd.h sys/xattr.h ustat.h
+for ac_header in asm/cachectl.h asm/guarded_storage.h asm/sysmips.h bluetooth/bluetooth.h elf.h iconv.h inttypes.h linux/bsg.h linux/cryptouser.h linux/dm-ioctl.h linux/dqblk_xfs.h linux/falloc.h linux/fib_rules.h linux/fiemap.h linux/genetlink.h linux/hiddev.h linux/if_addr.h linux/if_link.h linux/ip_vs.h linux/ipc.h linux/kcmp.h linux/kvm.h linux/memfd.h linux/mmtimer.h linux/msg.h linux/neighbour.h linux/netfilter/ipset/ip_set.h linux/netfilter/nf_tables.h linux/netfilter/nf_tables_compat.h linux/netfilter/nfnetlink.h linux/netfilter/nfnetlink_acct.h linux/netfilter/nfnetlink_conntrack.h linux/netfilter/nfnetlink_cthelper.h linux/netfilter/nfnetlink_cttimeout.h linux/netfilter/nfnetlink_log.h linux/netfilter/nfnetlink_queue.h linux/nsfs.h linux/perf_event.h linux/quota.h linux/seccomp.h linux/securebits.h linux/sem.h linux/shm.h linux/userfaultfd.h linux/utsname.h mqueue.h netinet/sctp.h netipx/ipx.h paths.h scsi/sg.h stropts.h sys/conf.h sys/eventfd.h sys/fanotify.h sys/ipc.h sys/msg.h sys/quota.h sys/reg.h sys/sem.h sys/shm.h sys/signalfd.h sys/xattr.h ustat.h
 do :
   as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
 ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
@@ -9859,215 +10186,86 @@
 #define HAVE_LINUX_BPF_H 1
 _ACEOF
 
+	ac_fn_c_check_member "$LINENO" "union bpf_attr" "attach_flags" "ac_cv_member_union_bpf_attr_attach_flags" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_attach_flags" = xyes; then :
 
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.attach_flags initialization works" >&5
-$as_echo_n "checking whether union bpf_attr.attach_flags initialization works... " >&6; }
-if ${st_cv_member_union_bpf_attr_attach_flags+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <linux/bpf.h>
-int
-main ()
-{
-union bpf_attr a = { .attach_flags = 0 };
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  st_cv_member_union_bpf_attr_attach_flags=yes
-else
-  st_cv_member_union_bpf_attr_attach_flags=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_member_union_bpf_attr_attach_flags" >&5
-$as_echo "$st_cv_member_union_bpf_attr_attach_flags" >&6; }
 
-if test $st_cv_member_union_bpf_attr_attach_flags = yes; then
-
-$as_echo "#define HAVE_UNION_BPF_ATTR_ATTACH_FLAGS 1" >>confdefs.h
 
 fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "bpf_fd" "ac_cv_member_union_bpf_attr_bpf_fd" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_bpf_fd" = xyes; then :
 
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.bpf_fd initialization works" >&5
-$as_echo_n "checking whether union bpf_attr.bpf_fd initialization works... " >&6; }
-if ${st_cv_member_union_bpf_attr_bpf_fd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <linux/bpf.h>
-int
-main ()
-{
-union bpf_attr a = { .bpf_fd = 0 };
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_BPF_FD 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  st_cv_member_union_bpf_attr_bpf_fd=yes
-else
-  st_cv_member_union_bpf_attr_bpf_fd=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_member_union_bpf_attr_bpf_fd" >&5
-$as_echo "$st_cv_member_union_bpf_attr_bpf_fd" >&6; }
 
-if test $st_cv_member_union_bpf_attr_bpf_fd = yes; then
-
-$as_echo "#define HAVE_UNION_BPF_ATTR_BPF_FD 1" >>confdefs.h
 
 fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "flags" "ac_cv_member_union_bpf_attr_flags" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_flags" = xyes; then :
 
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.flags initialization works" >&5
-$as_echo_n "checking whether union bpf_attr.flags initialization works... " >&6; }
-if ${st_cv_member_union_bpf_attr_flags+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <linux/bpf.h>
-int
-main ()
-{
-union bpf_attr a = { .flags = 0 };
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_FLAGS 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  st_cv_member_union_bpf_attr_flags=yes
-else
-  st_cv_member_union_bpf_attr_flags=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_member_union_bpf_attr_flags" >&5
-$as_echo "$st_cv_member_union_bpf_attr_flags" >&6; }
 
-if test $st_cv_member_union_bpf_attr_flags = yes; then
-
-$as_echo "#define HAVE_UNION_BPF_ATTR_FLAGS 1" >>confdefs.h
 
 fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "info.info" "ac_cv_member_union_bpf_attr_info_info" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_info_info" = xyes; then :
 
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.inner_map_fd initialization works" >&5
-$as_echo_n "checking whether union bpf_attr.inner_map_fd initialization works... " >&6; }
-if ${st_cv_member_union_bpf_attr_inner_map_fd+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <linux/bpf.h>
-int
-main ()
-{
-union bpf_attr a = { .inner_map_fd = 0 };
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_INFO_INFO 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  st_cv_member_union_bpf_attr_inner_map_fd=yes
-else
-  st_cv_member_union_bpf_attr_inner_map_fd=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_member_union_bpf_attr_inner_map_fd" >&5
-$as_echo "$st_cv_member_union_bpf_attr_inner_map_fd" >&6; }
 
-if test $st_cv_member_union_bpf_attr_inner_map_fd = yes; then
-
-$as_echo "#define HAVE_UNION_BPF_ATTR_INNER_MAP_FD 1" >>confdefs.h
 
 fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "next_id" "ac_cv_member_union_bpf_attr_next_id" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_next_id" = xyes; then :
 
-
-
-
-
-
-
-
-
-
-
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether union bpf_attr.prog_flags initialization works" >&5
-$as_echo_n "checking whether union bpf_attr.prog_flags initialization works... " >&6; }
-if ${st_cv_member_union_bpf_attr_prog_flags+:} false; then :
-  $as_echo_n "(cached) " >&6
-else
-  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
-/* end confdefs.h.  */
-#include <linux/bpf.h>
-int
-main ()
-{
-union bpf_attr a = { .prog_flags = 0 };
-  ;
-  return 0;
-}
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_NEXT_ID 1
 _ACEOF
-if ac_fn_c_try_compile "$LINENO"; then :
-  st_cv_member_union_bpf_attr_prog_flags=yes
-else
-  st_cv_member_union_bpf_attr_prog_flags=no
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
-fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_member_union_bpf_attr_prog_flags" >&5
-$as_echo "$st_cv_member_union_bpf_attr_prog_flags" >&6; }
 
-if test $st_cv_member_union_bpf_attr_prog_flags = yes; then
-
-$as_echo "#define HAVE_UNION_BPF_ATTR_PROG_FLAGS 1" >>confdefs.h
 
 fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "numa_node" "ac_cv_member_union_bpf_attr_numa_node" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_numa_node" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_NUMA_NODE 1
+_ACEOF
 
 
+fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "prog_flags" "ac_cv_member_union_bpf_attr_prog_flags" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_prog_flags" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_PROG_FLAGS 1
+_ACEOF
 
 
+fi
+ac_fn_c_check_member "$LINENO" "union bpf_attr" "test.duration" "ac_cv_member_union_bpf_attr_test_duration" "#include <linux/bpf.h>
+"
+if test "x$ac_cv_member_union_bpf_attr_test_duration" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_UNION_BPF_ATTR_TEST_DURATION 1
+_ACEOF
+
+
+fi
 
 
 fi
@@ -10456,6 +10654,74 @@
 fi
 
 
+ac_fn_c_check_type "$LINENO" "struct mtd_write_req" "ac_cv_type_struct_mtd_write_req" "#include <mtd/mtd-abi.h>
+"
+if test "x$ac_cv_type_struct_mtd_write_req" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_MTD_WRITE_REQ 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_member "$LINENO" "struct ubi_attach_req" "max_beb_per1024" "ac_cv_member_struct_ubi_attach_req_max_beb_per1024" "#include <mtd/ubi-user.h>
+"
+if test "x$ac_cv_member_struct_ubi_attach_req_max_beb_per1024" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "struct ptp_sys_offset" "ac_cv_type_struct_ptp_sys_offset" "#include <linux/ptp_clock.h>
+"
+if test "x$ac_cv_type_struct_ptp_sys_offset" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_PTP_SYS_OFFSET 1
+_ACEOF
+
+
+fi
+
+
+ac_fn_c_check_type "$LINENO" "struct kvm_regs" "ac_cv_type_struct_kvm_regs" "#include <linux/kvm.h>
+"
+if test "x$ac_cv_type_struct_kvm_regs" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_KVM_REGS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct kvm_sregs" "ac_cv_type_struct_kvm_sregs" "#include <linux/kvm.h>
+"
+if test "x$ac_cv_type_struct_kvm_sregs" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_KVM_SREGS 1
+_ACEOF
+
+
+fi
+ac_fn_c_check_type "$LINENO" "struct kvm_userspace_memory_region" "ac_cv_type_struct_kvm_userspace_memory_region" "#include <linux/kvm.h>
+"
+if test "x$ac_cv_type_struct_kvm_userspace_memory_region" = xyes; then :
+
+cat >>confdefs.h <<_ACEOF
+#define HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION 1
+_ACEOF
+
+
+fi
+
+
 for ac_header in linux/btrfs.h
 do :
   ac_fn_c_check_header_mongrel "$LINENO" "linux/btrfs.h" "ac_cv_header_linux_btrfs_h" "$ac_includes_default"
@@ -12478,6 +12744,8 @@
 _ACEOF
 
 
+SIZEOF_LONG="$ac_cv_sizeof_long"
+
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -12579,6 +12847,8 @@
 _ACEOF
 
 
+SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
+
 # The cast to long int works around a bug in the HP C Compiler
 # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects
 # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'.
@@ -12614,6 +12884,7 @@
 
 
 
+
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for SIGRTMIN" >&5
 $as_echo_n "checking for SIGRTMIN... " >&6; }
 if ${st_cv_SIGRTMIN+:} false; then :
@@ -12807,6 +13078,99 @@
 
 
 
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}readelf", so it can be a program name with args.
+set dummy ${ac_tool_prefix}readelf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_READELF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$READELF"; then
+  ac_cv_prog_READELF="$READELF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_READELF="${ac_tool_prefix}readelf"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+READELF=$ac_cv_prog_READELF
+if test -n "$READELF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $READELF" >&5
+$as_echo "$READELF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_READELF"; then
+  ac_ct_READELF=$READELF
+  # Extract the first word of "readelf", so it can be a program name with args.
+set dummy readelf; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_READELF+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_READELF"; then
+  ac_cv_prog_ac_ct_READELF="$ac_ct_READELF" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_READELF="readelf"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_READELF=$ac_cv_prog_ac_ct_READELF
+if test -n "$ac_ct_READELF"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_READELF" >&5
+$as_echo "$ac_ct_READELF" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_READELF" = x; then
+    READELF=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    READELF=$ac_ct_READELF
+  fi
+else
+  READELF="$ac_cv_prog_READELF"
+fi
+
+
 libunwind_CPPFLAGS=
 libunwind_LDFLAGS=
 libunwind_LIBS=
@@ -13024,19 +13388,152 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libunwind" >&5
 $as_echo "$use_libunwind" >&6; }
 
+libiberty_CPPFLAGS=
+libiberty_LDFLAGS=
+libiberty_LIBS=
+
+# Check whether --with-libiberty was given.
+if test "${with_libiberty+set}" = set; then :
+  withval=$with_libiberty; case "${withval}" in
+	     yes|no|check) ;;
+	     *) with_libiberty=yes
+		libiberty_CPPFLAGS="-I${withval}/include"
+		libiberty_LDFLAGS="-L${withval}/lib" ;;
+	     esac
+else
+  with_libiberty=check
+
+fi
+
+
+use_libiberty=no
+if test "x$use_libunwind" = xyes && test "x$with_libiberty" != xno; then :
+  saved_CPPFLAGS="$CPPFLAGS"
+       CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
+       for ac_header in demangle.h libiberty/demangle.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+ saved_LDFLAGS="$LDFLAGS"
+	  LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
+	  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for cplus_demangle in -liberty" >&5
+$as_echo_n "checking for cplus_demangle in -liberty... " >&6; }
+if ${ac_cv_lib_iberty_cplus_demangle+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-liberty  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char cplus_demangle ();
+int
+main ()
+{
+return cplus_demangle ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_iberty_cplus_demangle=yes
+else
+  ac_cv_lib_iberty_cplus_demangle=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_iberty_cplus_demangle" >&5
+$as_echo "$ac_cv_lib_iberty_cplus_demangle" >&6; }
+if test "x$ac_cv_lib_iberty_cplus_demangle" = xyes; then :
+  libiberty_LIBS="-liberty"
+	     use_libiberty=yes
+
+else
+  if test "x$with_libiberty" != xcheck; then
+	       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to find cplus_demangle in libiberty
+See \`config.log' for more details" "$LINENO" 5; }
+	     fi
+
+
+fi
+
+	  LDFLAGS="$saved_LDFLAGS"
+
+else
+  if test "x$with_libiberty" != xcheck; then
+	      { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to find demangle.h
+See \`config.log' for more details" "$LINENO" 5; }
+	  fi
+
+
+fi
+
+done
+
+       CPPFLAGS="$saved_CPPFLAGS"
+
+
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable demangling symbols in stack trace" >&5
+$as_echo_n "checking whether to enable demangling symbols in stack trace... " >&6; }
+if test "x$use_libiberty" = xyes; then
+
+$as_echo "#define USE_DEMANGLE 1" >>confdefs.h
+
+
+
+
+fi
+ if test "x$use_libiberty" = xyes; then
+  USE_DEMANGLE_TRUE=
+  USE_DEMANGLE_FALSE='#'
+else
+  USE_DEMANGLE_TRUE='#'
+  USE_DEMANGLE_FALSE=
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $use_libiberty" >&5
+$as_echo "$use_libiberty" >&6; }
+
 if test "$arch" = mips && test "$no_create" != yes; then
 	mkdir -p linux/mips
 	if $srcdir/linux/mips/genstub.sh linux/mips; then
 		{ $as_echo "$as_me:${as_lineno-$LINENO}: result: Generated MIPS syscallent stubs" >&5
 $as_echo "Generated MIPS syscallent stubs" >&6; }
 	else
-		{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
-$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-as_fn_error $? "Failed to generate syscallent stubs
-See \`config.log' for more details" "$LINENO" 5; }
+		as_fn_error $? "Failed to generate syscallent stubs" "$LINENO" 5
 	fi
 fi
 
+# Check whether --enable-mpers was given.
+if test "${enable_mpers+set}" = set; then :
+  enableval=$enable_mpers; case "$enableval" in
+		yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
+		*) as_fn_error $? "bad value $enableval for enable-mpers option.
+				 Valid options are: yes, no, check, m32, mx32." "$LINENO" 5
+		;;
+	 esac
+else
+  enable_mpers=yes
+fi
+
 
 
 
@@ -13048,8 +13545,12 @@
 
 
 
+
 case "$arch" in
-	aarch64|powerpc64|sparc64|tile|x32|x86_64)
+	aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64)
+	case "$enable_mpers" in
+	yes|check|m32)
+
 
 
 
@@ -13073,9 +13574,9 @@
 
 
 	saved_CFLAGS="$CFLAGS"
-	CFLAGS="$CFLAGS -m32 $IFLAG"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 compile support" >&5
-$as_echo_n "checking for -m32 compile support... " >&6; }
+	CFLAGS="$CFLAGS $cc_flags_m32 $IFLAG"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for m32 personality compile support" >&5
+$as_echo_n "checking for m32 personality compile support... " >&6; }
 if ${st_cv_m32_cc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -13094,8 +13595,8 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_cc" >&5
 $as_echo "$st_cv_m32_cc" >&6; }
 	if test $st_cv_m32_cc = yes; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -m32 runtime support" >&5
-$as_echo_n "checking for -m32 runtime support... " >&6; }
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for m32 personality runtime support" >&5
+$as_echo_n "checking for m32 personality runtime support... " >&6; }
 if ${st_cv_m32_runtime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -13119,13 +13620,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_runtime" >&5
 $as_echo "$st_cv_m32_runtime" >&6; }
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -m32 works" >&5
-$as_echo_n "checking whether mpers.sh -m32 works... " >&6; }
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh m32 $cc_flags_m32 works" >&5
+$as_echo_n "checking whether mpers.sh m32 $cc_flags_m32 works... " >&6; }
 if ${st_cv_m32_mpers+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \
-			    $srcdir/mpers_test.sh m32; then
+  if READELF="$READELF" \
+			    CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \
+			    $srcdir/mpers_test.sh m32 $cc_flags_m32; then
 				st_cv_m32_mpers=yes
 			 else
 				st_cv_m32_mpers=no
@@ -13479,7 +13981,27 @@
 	CFLAGS="$saved_CFLAGS"
 	;;
 
-	*)
+	*) # case "$enable_mpers"
+	st_cv_m32_runtime=no
+	st_cv_m32_mpers=no
+	;;
+	esac
+
+	test "$st_cv_m32_mpers" = yes ||
+		st_cv_m32_mpers=no
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable m32 personality support" >&5
+$as_echo_n "checking whether to enable m32 personality support... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_m32_mpers" >&5
+$as_echo "$st_cv_m32_mpers" >&6; }
+
+	case "$enable_mpers,$st_cv_m32_mpers" in
+	yes,no|m32,no)
+		as_fn_error $? "Cannot enable m32 personality support" "$LINENO" 5
+		;;
+	esac
+	;;
+
+	*) # case "$arch"
 	st_cv_m32_runtime=no
 	st_cv_m32_mpers=no
 	;;
@@ -13525,6 +14047,9 @@
 
 case "$arch" in
 	x86_64)
+	case "$enable_mpers" in
+	yes|check|mx32)
+
 
 
 
@@ -13548,9 +14073,9 @@
 
 
 	saved_CFLAGS="$CFLAGS"
-	CFLAGS="$CFLAGS -mx32 $IFLAG"
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 compile support" >&5
-$as_echo_n "checking for -mx32 compile support... " >&6; }
+	CFLAGS="$CFLAGS $cc_flags_mx32 $IFLAG"
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mx32 personality compile support" >&5
+$as_echo_n "checking for mx32 personality compile support... " >&6; }
 if ${st_cv_mx32_cc+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -13569,8 +14094,8 @@
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_cc" >&5
 $as_echo "$st_cv_mx32_cc" >&6; }
 	if test $st_cv_mx32_cc = yes; then
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -mx32 runtime support" >&5
-$as_echo_n "checking for -mx32 runtime support... " >&6; }
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for mx32 personality runtime support" >&5
+$as_echo_n "checking for mx32 personality runtime support... " >&6; }
 if ${st_cv_mx32_runtime+:} false; then :
   $as_echo_n "(cached) " >&6
 else
@@ -13594,13 +14119,14 @@
 fi
 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_runtime" >&5
 $as_echo "$st_cv_mx32_runtime" >&6; }
-		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh -mx32 works" >&5
-$as_echo_n "checking whether mpers.sh -mx32 works... " >&6; }
+		{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mpers.sh mx32 $cc_flags_mx32 works" >&5
+$as_echo_n "checking whether mpers.sh mx32 $cc_flags_mx32 works... " >&6; }
 if ${st_cv_mx32_mpers+:} false; then :
   $as_echo_n "(cached) " >&6
 else
-  if CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \
-			    $srcdir/mpers_test.sh mx32; then
+  if READELF="$READELF" \
+			    CC="$CC" CPP="$CPP" CPPFLAGS="$CPPFLAGS" \
+			    $srcdir/mpers_test.sh mx32 $cc_flags_mx32; then
 				st_cv_mx32_mpers=yes
 			 else
 				st_cv_mx32_mpers=no
@@ -13954,7 +14480,27 @@
 	CFLAGS="$saved_CFLAGS"
 	;;
 
-	*)
+	*) # case "$enable_mpers"
+	st_cv_mx32_runtime=no
+	st_cv_mx32_mpers=no
+	;;
+	esac
+
+	test "$st_cv_mx32_mpers" = yes ||
+		st_cv_mx32_mpers=no
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable mx32 personality support" >&5
+$as_echo_n "checking whether to enable mx32 personality support... " >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $st_cv_mx32_mpers" >&5
+$as_echo "$st_cv_mx32_mpers" >&6; }
+
+	case "$enable_mpers,$st_cv_mx32_mpers" in
+	yes,no|mx32,no)
+		as_fn_error $? "Cannot enable mx32 personality support" "$LINENO" 5
+		;;
+	esac
+	;;
+
+	*) # case "$arch"
 	st_cv_mx32_runtime=no
 	st_cv_mx32_mpers=no
 	;;
@@ -14399,7 +14945,7 @@
 
 
 
-ac_config_files="$ac_config_files Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile strace.1 strace.spec debian/changelog"
+ac_config_files="$ac_config_files Makefile tests/Makefile tests-m32/Makefile tests-mx32/Makefile strace.1 strace-log-merge.1 strace.spec debian/changelog"
 
 cat >confcache <<\_ACEOF
 # This file is a shell script that caches the results of configure
@@ -14551,6 +15097,10 @@
   as_fn_error $? "conditional \"USE_LIBUNWIND\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${USE_DEMANGLE_TRUE}" && test -z "${USE_DEMANGLE_FALSE}"; then
+  as_fn_error $? "conditional \"USE_DEMANGLE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${HAVE_M32_RUNTIME_TRUE}" && test -z "${HAVE_M32_RUNTIME_FALSE}"; then
   as_fn_error $? "conditional \"HAVE_M32_RUNTIME\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -14968,7 +15518,7 @@
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by strace $as_me 4.20, which was
+This file was extended by strace $as_me 4.21, which was
 generated by GNU Autoconf 2.69.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -15035,7 +15585,7 @@
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
 ac_cs_version="\\
-strace config.status 4.20
+strace config.status 4.21
 configured by $0, generated by GNU Autoconf 2.69,
   with options \\"\$ac_cs_config\\"
 
@@ -15171,6 +15721,7 @@
     "tests-m32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-m32/Makefile" ;;
     "tests-mx32/Makefile") CONFIG_FILES="$CONFIG_FILES tests-mx32/Makefile" ;;
     "strace.1") CONFIG_FILES="$CONFIG_FILES strace.1" ;;
+    "strace-log-merge.1") CONFIG_FILES="$CONFIG_FILES strace-log-merge.1" ;;
     "strace.spec") CONFIG_FILES="$CONFIG_FILES strace.spec" ;;
     "debian/changelog") CONFIG_FILES="$CONFIG_FILES debian/changelog" ;;
 
diff --git a/configure.ac b/configure.ac
index 29285db..86b8a8e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5,7 +5,7 @@
 # Copyright (c) 2006-2016 Dmitry V. Levin <ldv@altlinux.org>
 # Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
 # Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
-# Copyright (c) 2002-2017 The strace developers.
+# Copyright (c) 2002-2018 The strace developers.
 # All rights reserved.
 #
 # Redistribution and use in source and binary forms, with or without
@@ -52,6 +52,7 @@
 AC_SUBST(DEB_CHANGELOGTIME)
 
 AC_PROG_CC
+AC_PROG_CC_STDC
 AC_PROG_CPP
 st_WARN_CFLAGS
 AX_PROG_CC_FOR_BUILD
@@ -70,11 +71,38 @@
 AC_MSG_CHECKING([for supported architecture])
 arch_m32=
 arch_mx32=
+cc_flags_m32=-m32
+cc_flags_mx32=-mx32
 case "$host_cpu" in
+aarch64*)
+	arch=aarch64
+	arch_m32=arm
+	AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
+	;;
+alpha*)
+	arch=alpha
+	AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
+	;;
+arc*)
+	arch=arc
+	AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
+	;;
+arm*)
+	arch=arm
+	AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
+	;;
+avr32*)
+	arch=avr32
+	AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
+	;;
 bfin)
 	arch=bfin
 	AC_DEFINE([BFIN], 1, [Define for the Blackfin architecture.])
 	;;
+hppa*|parisc*)
+	arch=hppa
+	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
+	;;
 i[[3456]]86|pentium)
 	arch=i386
 	AC_DEFINE([I386], 1, [Define for the i386 architecture.])
@@ -87,26 +115,25 @@
 	arch=m68k
 	AC_DEFINE([M68K], 1, [Define for the m68k architecture.])
 	;;
-sparc64*)
-	arch=sparc64
-	arch_m32=sparc
-	AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
-	;;
-sparc*)
-	arch=sparc
-	AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
-	;;
 metag*)
 	arch=metag
 	AC_DEFINE([METAG], 1, [Define for the Meta architecture.])
 	;;
+microblaze*)
+	arch=microblaze
+	AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
+	;;
 mips*)
 	arch=mips
 	AC_DEFINE([MIPS], 1, [Define for the MIPS architecture.])
 	;;
-alpha*)
-	arch=alpha
-	AC_DEFINE([ALPHA], 1, [Define for the Alpha architecture.])
+nios2*)
+	arch=nios2
+	AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
+	;;
+or1k*)
+	arch=or1k
+	AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
 	;;
 powerpc*)
 	AC_DEFINE([POWERPC], 1, [Define for the PowerPC architecture.])
@@ -119,22 +146,9 @@
 		AC_DEFINE([POWERPC64], 1, [Define for the PowerPC64 architecture.])
 	fi
 	;;
-arm*)
-	arch=arm
-	AC_DEFINE([ARM], 1, [Define for the ARM architecture.])
-	;;
-aarch64*)
-	arch=aarch64
-	arch_m32=arm
-	AC_DEFINE([AARCH64], 1, [Define for the AArch64 architecture.])
-	;;
-avr32*)
-	arch=avr32
-	AC_DEFINE([AVR32], 1, [Define for the AVR32 architecture.])
-	;;
-arc*)
-	arch=arc
-	AC_DEFINE([ARC], 1, [Define for the ARC architecture.])
+riscv*)
+	arch=riscv
+	AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
 	;;
 s390)
 	arch=s390
@@ -142,12 +156,10 @@
 	;;
 s390x)
 	arch=s390x
+	arch_m32=s390
+	cc_flags_m32=-m31
 	AC_DEFINE([S390X], 1, [Define for the S390x architecture.])
 	;;
-hppa*|parisc*)
-	arch=hppa
-	AC_DEFINE([HPPA], 1, [Define for the HPPA architecture.])
-	;;
 sh64*)
 	arch=sh64
 	AC_DEFINE([SH64], 1, [Define for the SH64 architecture.])
@@ -156,6 +168,19 @@
 	arch=sh
 	AC_DEFINE([SH], 1, [Define for the SH architecture.])
 	;;
+sparc64*)
+	arch=sparc64
+	arch_m32=sparc
+	AC_DEFINE([SPARC64], 1, [Define for the SPARC64 architecture.])
+	;;
+sparc*)
+	arch=sparc
+	AC_DEFINE([SPARC], 1, [Define for the SPARC architecture.])
+	;;
+tile*)
+	arch=tile
+	AC_DEFINE([TILE], 1, [Define for the Tile architecture])
+	;;
 x86?64*)
 	arch_m32=i386
 	AC_TRY_COMPILE(
@@ -169,42 +194,10 @@
 		AC_DEFINE([X32], 1, [Define for the 32bit AMD x86-64 architecture.])
 	fi
 	;;
-cris|crisv10)
-	arch=crisv10
-	AC_DEFINE([CRISV10], 1, [Define for the CRISv10 architecture.])
-	;;
-crisv32)
-	arch=crisv32
-	AC_DEFINE([CRISV32], 1, [Define for the CRISv32 architecture.])
-	;;
-tile*)
-	arch=tile
-	AC_DEFINE([TILE], 1, [Define for the Tile architecture])
-	;;
-microblaze*)
-	arch=microblaze
-	AC_DEFINE([MICROBLAZE], 1, [Define for the MicroBlaze architecture.])
-	;;
-nios2*)
-	arch=nios2
-	AC_DEFINE([NIOS2], 1, [Define for the Nios-II architecture.])
-	;;
-
-or1k*)
-	arch=or1k
-	AC_DEFINE([OR1K], 1, [Define for the OpenRISC 1000 architecture.])
-	;;
-
 xtensa*)
 	arch=xtensa
 	AC_DEFINE([XTENSA], 1, [Define for the Xtensa architecture])
 	;;
-
-riscv*)
-	arch=riscv
-	AC_DEFINE([RISCV], 1, [Define for the RISC-V architecture])
-	;;
-
 *)
 	AC_MSG_RESULT([NO!])
 	AC_MSG_ERROR([architecture $host_cpu is not supported by strace])
@@ -212,6 +205,8 @@
 esac
 AC_MSG_RESULT($arch)
 
+arch_native=$arch
+
 test -n "$arch_m32" ||
 	arch_m32=$arch
 test -n "$arch_mx32" ||
@@ -219,12 +214,15 @@
 AC_SUBST(arch)
 AC_SUBST(arch_m32)
 AC_SUBST(arch_mx32)
+AC_SUBST(cc_flags_m32)
+AC_SUBST(cc_flags_mx32)
+AC_SUBST(arch_native)
 
 MIPS_ABI=
 if test "$arch" = mips; then
 	AC_CACHE_CHECK([for _MIPS_SIM], [st_cv__MIPS_SIM],
 		       [AC_COMPUTE_INT([st_cv__MIPS_SIM], [_MIPS_SIM], ,
-				       [AC_MSG_ERROR([_MIPS_SIM cannot be determined])])])
+				       [AC_MSG_FAILURE([_MIPS_SIM cannot be determined])])])
 
 	# requires GCC >= 3.4
 	AC_CACHE_CHECK([for MIPS ABI], [st_cv_mips_abi],
@@ -277,6 +275,7 @@
 	fstatat
 	ftruncate
 	futimens
+	iconv_open
 	if_indextoname
 	open64
 	prctl
@@ -304,7 +303,10 @@
 [#include <sys/types.h>
 #include <asm/stat.h>])
 
-AC_CHECK_TYPES([struct user_desc],,, [#include <asm/ldt.h>])
+AC_CHECK_TYPES([struct user_desc],
+	       [AC_CHECK_MEMBERS([struct user_desc.lm],,,
+				 [#include <asm/ldt.h>])],,
+	       [#include <asm/ldt.h>])
 
 AC_CHECK_MEMBERS([struct stat.st_mtime_nsec, struct stat64.st_mtime_nsec],,,
 [#include <sys/types.h>
@@ -364,6 +366,7 @@
 	struct perf_event_attr.use_clockid,
 	struct perf_event_attr.context_switch,
 	struct perf_event_attr.write_backward,
+	struct perf_event_attr.namespaces,
 	struct perf_event_attr.bp_type,
 	struct perf_event_attr.config1,
 	struct perf_event_attr.config2,
@@ -377,9 +380,11 @@
 
 AC_CHECK_HEADERS(m4_normalize([
 	asm/cachectl.h
+	asm/guarded_storage.h
 	asm/sysmips.h
 	bluetooth/bluetooth.h
 	elf.h
+	iconv.h
 	inttypes.h
 	linux/bsg.h
 	linux/cryptouser.h
@@ -395,6 +400,8 @@
 	linux/ip_vs.h
 	linux/ipc.h
 	linux/kcmp.h
+	linux/kvm.h
+	linux/memfd.h
 	linux/mmtimer.h
 	linux/msg.h
 	linux/neighbour.h
@@ -420,6 +427,7 @@
 	mqueue.h
 	netinet/sctp.h
 	netipx/ipx.h
+	paths.h
 	scsi/sg.h
 	stropts.h
 	sys/conf.h
@@ -458,11 +466,16 @@
 ])
 
 AC_CHECK_HEADERS([linux/bpf.h], [
-	st_CHECK_UNION_BPF_ATTR([attach_flags])
-	st_CHECK_UNION_BPF_ATTR([bpf_fd])
-	st_CHECK_UNION_BPF_ATTR([flags])
-	st_CHECK_UNION_BPF_ATTR([inner_map_fd])
-	st_CHECK_UNION_BPF_ATTR([prog_flags])
+	AC_CHECK_MEMBERS(m4_normalize([
+		union bpf_attr.attach_flags,
+		union bpf_attr.bpf_fd,
+		union bpf_attr.flags,
+		union bpf_attr.info.info,
+		union bpf_attr.next_id,
+		union bpf_attr.numa_node,
+		union bpf_attr.prog_flags,
+		union bpf_attr.test.duration
+	]),,, [#include <linux/bpf.h>])
 ])
 
 AC_CHECK_TYPES(m4_normalize([
@@ -534,6 +547,20 @@
 
 AC_CHECK_TYPES([struct blk_user_trace_setup],,, [#include <linux/blktrace_api.h>])
 
+AC_CHECK_TYPES([struct mtd_write_req],,, [#include <mtd/mtd-abi.h>])
+
+AC_CHECK_MEMBERS([struct ubi_attach_req.max_beb_per1024],,, [#include <mtd/ubi-user.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+	struct ptp_sys_offset
+]),,, [#include <linux/ptp_clock.h>])
+
+AC_CHECK_TYPES(m4_normalize([
+	struct kvm_regs,
+	struct kvm_sregs,
+	struct kvm_userspace_memory_region
+]),,, [#include <linux/kvm.h>])
+
 AC_CHECK_HEADERS([linux/btrfs.h], [
 	AC_CHECK_MEMBERS(m4_normalize([
 		struct btrfs_ioctl_feature_flags.compat_flags,
@@ -728,11 +755,16 @@
 	fi)
 
 AC_CHECK_SIZEOF([long])
+SIZEOF_LONG="$ac_cv_sizeof_long"
+AC_SUBST(SIZEOF_LONG)
 AC_CHECK_SIZEOF([long long])
 AC_CHECK_SIZEOF([off_t],,[#include <sys/types.h>])
 AC_CHECK_SIZEOF([kernel_long_t],,[#include "$srcdir/kernel_types.h"])
+SIZEOF_KERNEL_LONG_T="$ac_cv_sizeof_kernel_long_t"
+AC_SUBST(SIZEOF_KERNEL_LONG_T)
 AC_CHECK_SIZEOF([struct i64_i32],,[struct i64_i32 {long long i64; int i32;};])
 
+
 AC_CACHE_CHECK([for SIGRTMIN], [st_cv_SIGRTMIN],
 	       [[st_cv_SIGRTMIN="$(echo SIGRTMIN |
 			$CPP $CPPFLAGS -P -imacros asm/signal.h - |
@@ -779,6 +811,8 @@
 
 AC_PATH_PROG([PERL], [perl])
 
+AC_CHECK_TOOL([READELF], [readelf])
+
 dnl stack trace with libunwind
 libunwind_CPPFLAGS=
 libunwind_LDFLAGS=
@@ -868,16 +902,84 @@
 AM_CONDITIONAL([USE_LIBUNWIND], [test "x$use_libunwind" = xyes])
 AC_MSG_RESULT([$use_libunwind])
 
+dnl demangling symbols in the stack trace
+libiberty_CPPFLAGS=
+libiberty_LDFLAGS=
+libiberty_LIBS=
+AC_ARG_WITH([libiberty],
+	    [AS_HELP_STRING([--with-libiberty],
+			    [use libiberty to demangle symbols in stack trace])],
+	    [case "${withval}" in
+	     yes|no|check) ;;
+	     *) with_libiberty=yes
+		libiberty_CPPFLAGS="-I${withval}/include"
+		libiberty_LDFLAGS="-L${withval}/lib" ;;
+	     esac],
+	    [with_libiberty=check]
+)
+
+use_libiberty=no
+AS_IF([test "x$use_libunwind" = xyes && test "x$with_libiberty" != xno],
+      [saved_CPPFLAGS="$CPPFLAGS"
+       CPPFLAGS="$CPPFLAGS $libiberty_CPPFLAGS"
+       AC_CHECK_HEADERS([demangle.h libiberty/demangle.h],
+	 [saved_LDFLAGS="$LDFLAGS"
+	  LDFLAGS="$LDFLAGS $libiberty_LDFLAGS"
+	  AC_CHECK_LIB([iberty],[cplus_demangle],
+	    [libiberty_LIBS="-liberty"
+	     use_libiberty=yes
+	    ],
+	    [if test "x$with_libiberty" != xcheck; then
+	       AC_MSG_FAILURE([failed to find cplus_demangle in libiberty])
+	     fi
+	    ]
+	  )
+	  LDFLAGS="$saved_LDFLAGS"
+	 ],
+	 [if test "x$with_libiberty" != xcheck; then
+	      AC_MSG_FAILURE([failed to find demangle.h])
+	  fi
+	 ]
+       )
+       CPPFLAGS="$saved_CPPFLAGS"
+      ]
+)
+
+dnl enable libiberty
+AC_MSG_CHECKING([whether to enable demangling symbols in stack trace])
+if test "x$use_libiberty" = xyes; then
+	AC_DEFINE([USE_DEMANGLE], 1, [Do demangling symbols in stack trace])
+	AC_SUBST(libiberty_LIBS)
+	AC_SUBST(libiberty_LDFLAGS)
+	AC_SUBST(libiberty_CPPFLAGS)
+fi
+AM_CONDITIONAL([USE_DEMANGLE], [test "x$use_libiberty" = xyes])
+AC_MSG_RESULT([$use_libiberty])
+
 if test "$arch" = mips && test "$no_create" != yes; then
 	mkdir -p linux/mips
 	if $srcdir/linux/mips/genstub.sh linux/mips; then
 		AC_MSG_RESULT([Generated MIPS syscallent stubs])
 	else
-		AC_MSG_FAILURE([Failed to generate syscallent stubs])
+		AC_MSG_ERROR([Failed to generate syscallent stubs])
 	fi
 fi
 
-st_MPERS([m32], [aarch64|powerpc64|sparc64|tile|x32|x86_64])
+AC_ARG_ENABLE([mpers],
+	[AS_HELP_STRING([--enable-mpers=yes|no|check|m32|mx32],
+		[whether to enable multiple personalities support required
+		 for proper decoding of structures used by tracees with
+		 personalities that differ from the personality of strace,
+		 default is yes.])],
+	[case "$enableval" in
+		yes|no|check|m32|mx32) enable_mpers="$enableval" ;;
+		*) AC_MSG_ERROR([bad value $enableval for enable-mpers option.
+				 Valid options are: yes, no, check, m32, mx32.])
+		;;
+	 esac],
+	[enable_mpers=yes])
+
+st_MPERS([m32], [aarch64|powerpc64|riscv|s390x|sparc64|tile|x32|x86_64])
 st_MPERS([mx32], [x86_64])
 
 AX_VALGRIND_DFLT([sgcheck], [off])
@@ -888,6 +990,7 @@
 		 tests-m32/Makefile
 		 tests-mx32/Makefile
 		 strace.1
+		 strace-log-merge.1
 		 strace.spec
 		 debian/changelog])
 AC_OUTPUT
diff --git a/count.c b/count.c
index f5e4f12..2065e71 100644
--- a/count.c
+++ b/count.c
@@ -8,7 +8,7 @@
  *                    <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
  * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
  * Copyright (c) 2006 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2006-2017 The strace developers.
+ * Copyright (c) 2006-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -40,7 +40,7 @@
 struct call_counts {
 	/* time may be total latency or system time */
 	struct timeval time;
-	int calls, errors;
+	unsigned int calls, errors;
 };
 
 static struct call_counts *countv[SUPPORTED_PERSONALITIES];
@@ -154,22 +154,24 @@
 static void
 call_summary_pers(FILE *outf)
 {
+	static const char dashes[]  = "----------------";
+	static const char header[]  = "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n";
+	static const char data[]    = "%6.2f %11.6f %11lu %9u %9.u %s\n";
+	static const char summary[] = "%6.6s %11.6f %11.11s %9u %9.u %s\n";
+
 	unsigned int i;
-	int     call_cum, error_cum;
+	unsigned int call_cum, error_cum;
 	struct timeval tv_cum, dtv;
 	double  float_tv_cum;
 	double  percent;
-	const char *dashes = "----------------";
-	char    error_str[sizeof(int)*3];
-	int    *sorted_count;
+	unsigned int *sorted_count;
 
-	fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
+	fprintf(outf, header,
 		"% time", "seconds", "usecs/call",
 		"calls", "errors", "syscall");
-	fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
-		dashes, dashes, dashes, dashes, dashes, dashes);
+	fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
 
-	sorted_count = xcalloc(sizeof(int), nsyscalls);
+	sorted_count = xcalloc(sizeof(sorted_count[0]), nsyscalls);
 	call_cum = error_cum = tv_cum.tv_sec = tv_cum.tv_usec = 0;
 	if (overhead.tv_sec == -1) {
 		tv_mul(&overhead, &shortest, 8);
@@ -188,39 +190,32 @@
 	float_tv_cum = tv_float(&tv_cum);
 	if (counts) {
 		if (sortfun)
-			qsort((void *) sorted_count, nsyscalls, sizeof(int), sortfun);
+			qsort((void *) sorted_count, nsyscalls,
+			      sizeof(sorted_count[0]), sortfun);
 		for (i = 0; i < nsyscalls; i++) {
 			double float_syscall_time;
-			int idx = sorted_count[i];
+			unsigned int idx = sorted_count[i];
 			struct call_counts *cc = &counts[idx];
 			if (cc->calls == 0)
 				continue;
 			tv_div(&dtv, &cc->time, cc->calls);
-			error_str[0] = '\0';
-			if (cc->errors)
-				sprintf(error_str, "%u", cc->errors);
 			float_syscall_time = tv_float(&cc->time);
 			percent = (100.0 * float_syscall_time);
 			if (percent != 0.0)
 				   percent /= float_tv_cum;
 			/* else: float_tv_cum can be 0.0 too and we get 0/0 = NAN */
-			fprintf(outf, "%6.2f %11.6f %11lu %9u %9.9s %s\n",
+			fprintf(outf, data,
 				percent, float_syscall_time,
 				(long) (1000000 * dtv.tv_sec + dtv.tv_usec),
-				cc->calls,
-				error_str, sysent[idx].sys_name);
+				cc->calls, cc->errors, sysent[idx].sys_name);
 		}
 	}
 	free(sorted_count);
 
-	fprintf(outf, "%6.6s %11.11s %11.11s %9.9s %9.9s %s\n",
-		dashes, dashes, dashes, dashes, dashes, dashes);
-	error_str[0] = '\0';
-	if (error_cum)
-		sprintf(error_str, "%u", error_cum);
-	fprintf(outf, "%6.6s %11.6f %11.11s %9u %9.9s %s\n",
+	fprintf(outf, header, dashes, dashes, dashes, dashes, dashes, dashes);
+	fprintf(outf, summary,
 		"100.00", float_tv_cum, "",
-		call_cum, error_str, "total");
+		call_cum, error_cum, "total");
 }
 
 void
@@ -236,8 +231,8 @@
 			set_personality(i);
 		if (i)
 			fprintf(outf,
-				"System call usage summary for %d bit mode:\n",
-				current_wordsize * 8);
+				"System call usage summary for %s mode:\n",
+				personality_names[i]);
 		call_summary_pers(outf);
 	}
 
diff --git a/debian/changelog b/debian/changelog
index 2579044..19574cf 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,14 @@
-strace (4.20-1) experimental; urgency=low
+strace (4.21-1) experimental; urgency=low
 
-  * strace 4.20 snapshot.
+  * strace 4.21 snapshot.
 
- -- Strace <strace-devel@lists.sourceforge.net>  Mon, 13 Nov 2017 21:49:34 +0000
+ -- Strace <strace-devel@lists.sourceforge.net>  Tue, 13 Feb 2018 23:10:19 +0000
+
+strace (4.20-1) unstable; urgency=medium
+
+  * New upstream version.
+
+ -- Dmitry V. Levin <ldv@altlinux.org>  Mon, 13 Nov 2017 20:21:22 +0000
 
 strace (4.19-1) unstable; urgency=medium
 
diff --git a/debian/changelog.in b/debian/changelog.in
index 16f34d8..02bf4b8 100644
--- a/debian/changelog.in
+++ b/debian/changelog.in
@@ -4,6 +4,12 @@
 
  -- Strace <@PACKAGE_BUGREPORT@>  @DEB_CHANGELOGTIME@
 
+strace (4.20-1) unstable; urgency=medium
+
+  * New upstream version.
+
+ -- Dmitry V. Levin <ldv@altlinux.org>  Mon, 13 Nov 2017 20:21:22 +0000
+
 strace (4.19-1) unstable; urgency=medium
 
   * New upstream version.
diff --git a/debian/control b/debian/control
index 92cdc20..477b9d9 100644
--- a/debian/control
+++ b/debian/control
@@ -2,7 +2,7 @@
 Maintainer: Steve McIntyre <93sam@debian.org>
 Section: utils
 Priority: optional
-Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 s390 sparc sparc64 x32], debhelper (>= 7.0.0), gawk
+Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [amd64 i386 powerpc ppc64 s390 sparc sparc64 x32], debhelper (>= 7.0.0), gawk, libunwind-dev [amd64], libiberty-dev [amd64]
 Standards-Version: 3.9.8
 Homepage: https://strace.io
 Vcs-Git: https://anonscm.debian.org/git/collab-maint/strace.git
diff --git a/debian/rules b/debian/rules
index d03cd5c..2ba864b 100755
--- a/debian/rules
+++ b/debian/rules
@@ -23,6 +23,8 @@
 DEB_HOST_GNU_TYPE := $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
 
+extra_build_targets += build-udeb-stamp
+
 arch64_map = i386=x86_64 powerpc=powerpc64 sparc=sparc64 s390=s390x
 ifneq (,$(filter $(DEB_HOST_ARCH)=%, $(arch64_map)))
   HOST64 = $(strip $(patsubst $(DEB_HOST_ARCH)=%, %, \
@@ -47,22 +49,28 @@
 %-stamp: %/Makefile
 	$(MAKE) -C $*
 ifeq (,$(findstring nocheck,$(DEB_BUILD_OPTIONS)))
+	$*/strace -V
 	$(MAKE) -C $* check VERBOSE=1
 endif
 	touch $@
 
 build/Makefile:
 	mkdir -p $(@D)
-	cd $(@D); sh ../configure --prefix=/usr $(CONFIG_OPTS)
+	cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr $(CONFIG_OPTS)
+
+build-udeb/Makefile:
+	mkdir -p $(@D)
+	cd $(@D); sh ../configure --enable-mpers=check --prefix=/usr \
+		--without-libunwind --without-libiberty $(CONFIG_OPTS)
 
 build64/Makefile:
 	mkdir -p $(@D)
-	cd $(@D); CC="$(CC64)" sh ../configure --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
+	cd $(@D); CC="$(CC64)" sh ../configure --enable-mpers=check --prefix=/usr --build=$(DEB_BUILD_GNU_TYPE) --host=$(HOST64)
 
 clean:
 	dh_testdir
 	dh_testroot
-	rm -rf build build64 strace64.1 debian/strace64.substvars
+	rm -rf build build-udeb build64 strace64.1 debian/strace64.substvars
 	dh_clean
 
 binary: binary-indep binary-arch
diff --git a/debian/strace-udeb.install b/debian/strace-udeb.install
index 1f41928..d823419 100644
--- a/debian/strace-udeb.install
+++ b/debian/strace-udeb.install
@@ -1 +1 @@
-build/strace usr/bin
+build-udeb/strace usr/bin
diff --git a/debian/strace.install b/debian/strace.install
index 1f41928..30b0a6b 100644
--- a/debian/strace.install
+++ b/debian/strace.install
@@ -1 +1,2 @@
 build/strace usr/bin
+strace-log-merge usr/bin
diff --git a/debian/strace.manpages b/debian/strace.manpages
index 5e74dd7..d3b9448 100644
--- a/debian/strace.manpages
+++ b/debian/strace.manpages
@@ -1 +1,2 @@
 strace.1
+strace-log-merge.1
diff --git a/defs.h b/defs.h
index b1a6b95..de55d3b 100644
--- a/defs.h
+++ b/defs.h
@@ -2,7 +2,7 @@
  * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 2001-2017 The strace developers.
+ * Copyright (c) 2001-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -53,13 +53,13 @@
 #include <time.h>
 #include <sys/time.h>
 
+#include "arch_defs.h"
 #include "error_prints.h"
 #include "gcc_compat.h"
 #include "kernel_types.h"
 #include "macros.h"
 #include "mpers_type.h"
 #include "string_to_uint.h"
-#include "supported_personalities.h"
 #include "sysent.h"
 #include "xmalloc.h"
 
@@ -149,10 +149,12 @@
 # define PERSONALITY1_INCLUDE_PRINTERS_DEFS "m32_printer_defs.h"
 # define PERSONALITY1_INCLUDE_FUNCS "m32_funcs.h"
 # define MPERS_m32_IOCTL_MACROS "ioctl_redefs1.h"
+# define HAVE_PERSONALITY_1_MPERS 1
 #else
 # define PERSONALITY1_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
 # define PERSONALITY1_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
 # define PERSONALITY1_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_1_MPERS 0
 #endif
 
 #if SUPPORTED_PERSONALITIES > 2 && defined HAVE_MX32_MPERS
@@ -160,10 +162,12 @@
 # define PERSONALITY2_INCLUDE_PRINTERS_DECLS "mx32_printer_decls.h"
 # define PERSONALITY2_INCLUDE_PRINTERS_DEFS "mx32_printer_defs.h"
 # define MPERS_mx32_IOCTL_MACROS "ioctl_redefs2.h"
+# define HAVE_PERSONALITY_2_MPERS 1
 #else
 # define PERSONALITY2_INCLUDE_PRINTERS_DECLS "native_printer_decls.h"
 # define PERSONALITY2_INCLUDE_PRINTERS_DEFS "native_printer_defs.h"
 # define PERSONALITY2_INCLUDE_FUNCS "empty.h"
+# define HAVE_PERSONALITY_2_MPERS 0
 #endif
 
 typedef struct ioctlent {
@@ -177,7 +181,7 @@
 struct inject_data {
 	uint16_t flags;
 	uint16_t signo;
-	int rval;
+	kernel_long_t rval;
 };
 
 struct inject_opts {
@@ -244,6 +248,10 @@
 #define TCB_TAMPERED	0x40	/* A syscall has been tampered with */
 #define TCB_HIDE_LOG	0x80	/* We should hide everything (until execve) */
 #define TCB_SKIP_DETACH_ON_FIRST_EXEC	0x100	/* -b execve should skip detach on first execve */
+#define TCB_GRABBED	0x200	/* We grab the process and can catch it
+				 * in the middle of a syscall */
+#define TCB_RECOVERING	0x400	/* We try to recover after detecting incorrect
+				 * syscall entering/exiting state */
 
 /* qualifier flags */
 #define QUAL_TRACE	0x001	/* this system call should be traced */
@@ -264,6 +272,8 @@
 #define inject(tcp)	((tcp)->qual_flg & QUAL_INJECT)
 #define filtered(tcp)	((tcp)->flags & TCB_FILTERED)
 #define hide_log(tcp)	((tcp)->flags & TCB_HIDE_LOG)
+#define syscall_tampered(tcp)	((tcp)->flags & TCB_TAMPERED)
+#define recovering(tcp)	((tcp)->flags & TCB_RECOVERING)
 
 #include "xlat.h"
 
@@ -309,6 +319,10 @@
 #define RVAL_DECODED	0100	/* syscall decoding finished */
 #define RVAL_IOCTL_DECODED 0200	/* ioctl sub-parser successfully decoded
 				   the argument */
+#define RVAL_PRINT_ERR_VAL 0400 /* Print decoded error code along with
+				   syscall return value.  Needed for modify_ldt
+				   that for some reason decides to return
+				   an error with higher bits set to 0.  */
 
 #define IOCTL_NUMBER_UNKNOWN 0
 #define IOCTL_NUMBER_HANDLED 1
@@ -316,22 +330,6 @@
 
 #define indirect_ipccall(tcp) (tcp->s_ent->sys_flags & TRACE_INDIRECT_SUBCALL)
 
-#if defined(ARM) || defined(AARCH64) \
- || defined(I386) || defined(X32) || defined(X86_64) \
- || defined(IA64) \
- || defined(BFIN) \
- || defined(M68K) \
- || defined(MICROBLAZE) \
- || defined(RISCV) \
- || defined(S390) \
- || defined(SH) || defined(SH64) \
- || defined(SPARC) || defined(SPARC64) \
- /**/
-# define NEED_UID16_PARSERS 1
-#else
-# define NEED_UID16_PARSERS 0
-#endif
-
 enum sock_proto {
 	SOCK_PROTO_UNKNOWN,
 	SOCK_PROTO_UNIX,
@@ -355,7 +353,6 @@
 	CFLAG_BOTH
 } cflag_t;
 extern cflag_t cflag;
-extern bool debug_flag;
 extern bool Tflag;
 extern bool iflag;
 extern bool count_wallclock;
@@ -365,7 +362,8 @@
 /* are we filtering traces based on paths? */
 extern struct path_set {
 	const char **paths_selected;
-	unsigned int num_selected;
+	size_t num_selected;
+	size_t size;
 } global_path_set;
 #define tracing_paths (global_path_set.num_selected != 0)
 extern unsigned xflag;
@@ -380,7 +378,7 @@
 #undef KERNEL_VERSION
 #define KERNEL_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
 
-extern int read_int_from_file(const char *, int *);
+extern int read_int_from_file(struct tcb *, const char *, int *);
 
 extern void set_sortby(const char *);
 extern void set_overhead(int);
@@ -397,18 +395,37 @@
 extern void count_syscall(struct tcb *, const struct timeval *);
 extern void call_summary(FILE *);
 
-extern void clear_regs(void);
+extern void clear_regs(struct tcb *tcp);
 extern int get_scno(struct tcb *);
 extern kernel_ulong_t get_rt_sigframe_addr(struct tcb *);
 
 /**
- * Convert syscall number to syscall name.
+ * Convert a (shuffled) syscall number to the corresponding syscall name.
  *
  * @param scno Syscall number.
  * @return     String literal corresponding to the syscall number in case latter
  *             is valid; NULL otherwise.
  */
 extern const char *syscall_name(kernel_ulong_t scno);
+/**
+ * Convert a syscall name to the corresponding (shuffled) syscall number.
+ *
+ * @param s     Syscall name.
+ * @param p     Personality.
+ * @param start From which position in syscall entry table resume the search.
+ * @return      Shuffled syscall number (ready to use against sysent_vec)
+ *              if syscall name is found; -1 otherwise.
+ */
+extern kernel_long_t scno_by_name(const char *s, unsigned p,
+				  kernel_long_t start);
+/**
+ * Shuffle syscall numbers so that we don't have huge gaps in syscall table.
+ * The shuffling should be an involution: shuffle_scno(shuffle_scno(n)) == n.
+ *
+ * @param scno Raw or shuffled syscall number.
+ * @return     Shuffled or raw syscall number, respectively.
+ */
+extern kernel_ulong_t shuffle_scno(kernel_ulong_t scno);
 extern const char *err_name(unsigned long err);
 
 extern bool is_erestart(struct tcb *);
@@ -448,8 +465,8 @@
 extern int
 umovestr(struct tcb *, kernel_ulong_t addr, unsigned int len, char *laddr);
 
-extern int upeek(int pid, unsigned long, kernel_ulong_t *);
-extern int upoke(int pid, unsigned long, kernel_ulong_t);
+extern int upeek(struct tcb *tcp, unsigned long, kernel_ulong_t *);
+extern int upoke(struct tcb *tcp, unsigned long, kernel_ulong_t);
 
 extern bool
 print_array(struct tcb *,
@@ -467,12 +484,8 @@
 				     void *opaque_data),
 	    void *opaque_data);
 
-#if defined ALPHA || defined IA64 || defined MIPS \
- || defined SH || defined SPARC || defined SPARC64
-# define HAVE_GETRVAL2
+#if HAVE_ARCH_GETRVAL2
 extern long getrval2(struct tcb *);
-#else
-# undef HAVE_GETRVAL2
 #endif
 
 extern const char *signame(const int);
@@ -495,7 +508,7 @@
 const struct xlat *dyxlat_get(const struct dyxlat *);
 void dyxlat_add_pair(struct dyxlat *, uint64_t val, const char *str, size_t len);
 
-const struct xlat *genl_families_xlat(void);
+const struct xlat *genl_families_xlat(struct tcb *tcp);
 
 extern unsigned long get_pagesize(void);
 extern int next_set_bit(const void *bit_array, unsigned cur_bit, unsigned size_bits);
@@ -518,6 +531,7 @@
 #define QUOTE_OMIT_LEADING_TRAILING_QUOTES	0x02
 #define QUOTE_OMIT_TRAILING_0			0x08
 #define QUOTE_FORCE_HEX				0x10
+#define QUOTE_EMIT_COMMENT			0x20
 
 extern int string_quote(const char *, char *, unsigned int, unsigned int);
 extern int print_quoted_string(const char *, unsigned int, unsigned int);
@@ -544,6 +558,8 @@
 	uint64_t val, const char *dflt);
 #define printxval_search(xlat__, val__, dflt__) \
 	printxval_searchn(xlat__, ARRAY_SIZE(xlat__), val__, dflt__)
+extern int sprintxval(char *buf, size_t size, const struct xlat *,
+	unsigned int val, const char *dflt);
 extern int printargs(struct tcb *);
 extern int printargs_u(struct tcb *);
 extern int printargs_d(struct tcb *);
@@ -561,6 +577,9 @@
 extern void print_dev_t(unsigned long long dev);
 extern void print_abnormal_hi(kernel_ulong_t);
 
+extern kernel_ulong_t *
+fetch_indirect_syscall_args(struct tcb *, kernel_ulong_t addr, unsigned int n_args);
+
 extern void
 dumpiov_in_msghdr(struct tcb *, kernel_ulong_t addr, kernel_ulong_t data_size);
 
@@ -573,14 +592,14 @@
 extern void
 dumpstr(struct tcb *, kernel_ulong_t addr, int len);
 
-extern void
+extern int
 printstr_ex(struct tcb *, kernel_ulong_t addr, kernel_ulong_t len,
 	    unsigned int user_style);
 
-extern void
+extern int
 printpathn(struct tcb *, kernel_ulong_t addr, unsigned int n);
 
-extern void
+extern int
 printpath(struct tcb *, kernel_ulong_t addr);
 
 #define TIMESPEC_TEXT_BUFSIZE \
@@ -658,6 +677,7 @@
 DECL_IOCTL(dm);
 DECL_IOCTL(file);
 DECL_IOCTL(fs_x);
+DECL_IOCTL(kvm);
 DECL_IOCTL(nsfs);
 DECL_IOCTL(ptp);
 DECL_IOCTL(scsi);
@@ -701,16 +721,16 @@
 extern void unwind_capture_stacktrace(struct tcb *);
 #endif
 
-static inline void
+static inline int
 printstrn(struct tcb *tcp, kernel_ulong_t addr, kernel_ulong_t len)
 {
-	printstr_ex(tcp, addr, len, 0);
+	return printstr_ex(tcp, addr, len, 0);
 }
 
-static inline void
+static inline int
 printstr(struct tcb *tcp, kernel_ulong_t addr)
 {
-	printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED);
+	return printstr_ex(tcp, addr, -1, QUOTE_0_TERMINATED);
 }
 
 static inline int
@@ -758,7 +778,21 @@
 #endif
 
 #ifdef HAVE_STRUCT_USER_DESC
-extern void print_user_desc(struct tcb *, kernel_ulong_t addr);
+/**
+ * Filter what to print from the point of view of the get_thread_area syscall.
+ * Kernel copies only entry_number field at first and then tries to write the
+ * whole structure.
+ */
+enum user_desc_print_filter {
+	/* Print the "entering" part of struct user_desc - entry_number.  */
+	USER_DESC_ENTERING = 1,
+	/* Print the "exiting" part of the structure.  */
+	USER_DESC_EXITING  = 2,
+	USER_DESC_BOTH     = USER_DESC_ENTERING | USER_DESC_EXITING,
+};
+
+extern void print_user_desc(struct tcb *, kernel_ulong_t addr,
+			    enum user_desc_print_filter filter);
 #endif
 
 /* Strace log generation machinery.
@@ -788,7 +822,7 @@
 extern void tprints_comment(const char *str);
 
 #if SUPPORTED_PERSONALITIES > 1
-extern void set_personality(int personality);
+extern void set_personality(unsigned int personality);
 extern unsigned current_personality;
 #else
 # define set_personality(personality) ((void)0)
@@ -811,9 +845,12 @@
 # endif
 #endif
 
-#define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG	\
-	(SIZEOF_KERNEL_LONG_T > 4		\
-	 && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize)))
+#if SIZEOF_KERNEL_LONG_T > 4		\
+ && (SIZEOF_LONG < SIZEOF_KERNEL_LONG_T || !defined(current_wordsize))
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG	1
+#else
+# define ANY_WORDSIZE_LESS_THAN_KERNEL_LONG	0
+#endif
 
 #define DECL_PRINTNUM(name)						\
 extern bool								\
@@ -942,6 +979,8 @@
 extern const char *const signalent0[];
 extern const struct_ioctlent ioctlent0[];
 
+extern const char *const personality_names[];
+
 #if SUPPORTED_PERSONALITIES > 1
 extern const struct_sysent *sysent;
 extern const char *const *errnoent;
diff --git a/desc.c b/desc.c
index 52e58c8..f99d25c 100644
--- a/desc.c
+++ b/desc.c
@@ -3,7 +3,7 @@
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
  * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
- * Copyright (c) 1999-2017 The strace developers.
+ * Copyright (c) 1999-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -30,6 +30,7 @@
  */
 
 #include "defs.h"
+#include "xstring.h"
 
 SYS_FUNC(close)
 {
@@ -157,7 +158,9 @@
 				/* +2 chars needed at the end: ']',NUL */
 				if (outptr < end_outstr - (sizeof(", except [") + sizeof(int)*3 + 2)) {
 					if (first) {
-						outptr += sprintf(outptr, "%s%s [%u",
+						outptr = xappendstr(outstr,
+							outptr,
+							"%s%s [%u",
 							sep,
 							i == 0 ? "in" : i == 1 ? "out" : "except",
 							j
@@ -165,7 +168,9 @@
 						first = 0;
 						sep = ", ";
 					} else {
-						outptr += sprintf(outptr, " %u", j);
+						outptr = xappendstr(outstr,
+							outptr,
+							" %u", j);
 					}
 				}
 				if (--ready_fds == 0)
@@ -179,7 +184,8 @@
 		if (args[4]) {
 			const char *str = sprint_tv_ts(tcp, args[4]);
 			if (outptr + sizeof("left ") + strlen(sep) + strlen(str) < end_outstr) {
-				outptr += sprintf(outptr, "%sleft %s", sep, str);
+				outptr = xappendstr(outstr, outptr,
+						    "%sleft %s", sep, str);
 			}
 		}
 		*outptr = '\0';
@@ -190,29 +196,21 @@
 	return 0;
 }
 
+#if HAVE_ARCH_OLD_SELECT
 SYS_FUNC(oldselect)
 {
-	kernel_ulong_t select_args[5];
-	unsigned int oldselect_args[5];
+	kernel_ulong_t *args =
+		fetch_indirect_syscall_args(tcp, tcp->u_arg[0], 5);
 
-	if (sizeof(*select_args) == sizeof(*oldselect_args)) {
-		if (umove_or_printaddr(tcp, tcp->u_arg[0], &select_args)) {
-			return 0;
-		}
+	if (args) {
+		return decode_select(tcp, args, print_timeval, sprint_timeval);
 	} else {
-		unsigned int i;
-
-		if (umove_or_printaddr(tcp, tcp->u_arg[0], &oldselect_args)) {
-			return 0;
-		}
-
-		for (i = 0; i < 5; ++i) {
-			select_args[i] = oldselect_args[i];
-		}
+		if (entering(tcp))
+			printaddr(tcp->u_arg[0]);
+		return RVAL_DECODED;
 	}
-
-	return decode_select(tcp, select_args, print_timeval, sprint_timeval);
 }
+#endif /* HAVE_ARCH_OLD_SELECT */
 
 #ifdef ALPHA
 SYS_FUNC(osf_select)
diff --git a/dm.c b/dm.c
index 28863a8..32b3310 100644
--- a/dm.c
+++ b/dm.c
@@ -258,6 +258,7 @@
 	uint32_t offset = ioc->data_start;
 	uint32_t offset_end = 0;
 	uint32_t count;
+	int rc;
 
 	if (ioc->data_start == ioc->data_size)
 		return;
@@ -288,8 +289,36 @@
 
 		PRINT_FIELD_DEV("{", s, dev);
 		tprints(", name=");
-		printstr_ex(tcp, addr + offset_end, ioc->data_size - offset_end,
-			    QUOTE_0_TERMINATED);
+		rc = printstr_ex(tcp, addr + offset_end,
+				 ioc->data_size - offset_end,
+				 QUOTE_0_TERMINATED);
+
+		/*
+		 * In Linux v4.13-rc1~137^2~13 it has been decided to cram in
+		 * one more undocumented field after the device name, as if the
+		 * format decoding was not twisted enough already. So, we have
+		 * to check "next" now, and if it _looks like_ that there is
+		 * a space for one additional integer, let's print it. As if the
+		 * perversity with "name string going further than pointer to
+		 * the next one" wasn't enough. Moreover, the calculation was
+		 * broken for m32 on 64-bit kernels until v4.14-rc4~20^2~3, and
+		 * we have no ability to detect kernel bit-ness (on x86, at
+		 * least), so refrain from printing it for the DM versions below
+		 * 4.37 (the original version was also aligned differently than
+		 * now even on 64 bit).
+		 */
+
+		if ((rc > 0) && ioc->version[1] >= 37) {
+			kernel_ulong_t event_addr =
+				(addr + offset_end + rc + 7) & ~7;
+			uint32_t event_nr;
+
+			if ((event_addr + sizeof(event_nr)) <=
+			    (addr + offset + s.next) &&
+			    !umove(tcp, event_addr, &event_nr))
+				tprintf(", event_nr=%" PRIu32, event_nr);
+		}
+
 		tprints("}");
 
 		if (!s.next)
diff --git a/dyxlat.c b/dyxlat.c
index ef6bef4..55d2cbc 100644
--- a/dyxlat.c
+++ b/dyxlat.c
@@ -44,8 +44,8 @@
 	struct dyxlat *const dyxlat = xmalloc(sizeof(*dyxlat));
 
 	dyxlat->used = 1;
-	dyxlat->allocated = nmemb ? nmemb : 16;
-	dyxlat->xlat = xcalloc(dyxlat->allocated, sizeof(struct xlat));
+	dyxlat->allocated = nmemb;
+	dyxlat->xlat = xgrowarray(NULL, &dyxlat->allocated, sizeof(struct xlat));
 	MARK_END(dyxlat->xlat[0]);
 
 	return dyxlat;
@@ -90,11 +90,9 @@
 		}
 	}
 
-	if (dyxlat->used >= dyxlat->allocated) {
-		dyxlat->allocated *= 2;
-		dyxlat->xlat = xreallocarray(dyxlat->xlat, dyxlat->allocated,
-					     sizeof(struct xlat));
-	}
+	if (dyxlat->used >= dyxlat->allocated)
+		dyxlat->xlat = xgrowarray(dyxlat->xlat, &dyxlat->allocated,
+					  sizeof(struct xlat));
 
 	dyxlat->xlat[dyxlat->used - 1].val = val;
 	dyxlat->xlat[dyxlat->used - 1].str = xstrndup(str, len);
diff --git a/error_prints.h b/error_prints.h
index 7ddcb50..99c8038 100644
--- a/error_prints.h
+++ b/error_prints.h
@@ -33,8 +33,12 @@
 #ifndef STRACE_ERROR_PRINTS_H
 #define STRACE_ERROR_PRINTS_H
 
+#include <stdbool.h>
+
 #include "gcc_compat.h"
 
+extern bool debug_flag;
+
 void die(void) ATTRIBUTE_NORETURN;
 
 void error_msg(const char *fmt, ...) ATTRIBUTE_FORMAT((printf, 1, 2));
@@ -46,4 +50,30 @@
 void error_msg_and_die(const char *fmt, ...)
 	ATTRIBUTE_FORMAT((printf, 1, 2)) ATTRIBUTE_NORETURN;
 
+/* Wrappers for if (debug_flag) error_msg(...) */
+#define debug_msg(...) \
+	do { \
+		if (debug_flag) \
+			error_msg(__VA_ARGS__); \
+	} while (0)
+#define debug_perror_msg(...) \
+	do { \
+		if (debug_flag) \
+			perror_msg(__VA_ARGS__); \
+	} while (0)
+
+/* Simple wrappers for providing function name in error messages */
+#define error_func_msg(fmt_, ...) \
+	error_msg("%s: " fmt_,  __func__, ##__VA_ARGS__)
+#define perror_func_msg(fmt_, ...) \
+	perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+#define debug_func_msg(fmt_, ...) \
+	debug_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+#define debug_func_perror_msg(fmt_, ...) \
+	debug_perror_msg("%s: " fmt_, __func__, ##__VA_ARGS__)
+#define error_func_msg_and_die(fmt_, ...) \
+	error_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
+#define perror_func_msg_and_die(fmt_, ...) \
+	perror_msg_and_die("%s: " fmt_, __func__, ##__VA_ARGS__)
+
 #endif /* !STRACE_ERROR_PRINTS_H */
diff --git a/linux/crisv10/arch_rt_sigframe.c b/fetch_indirect_syscall_args.c
similarity index 64%
copy from linux/crisv10/arch_rt_sigframe.c
copy to fetch_indirect_syscall_args.c
index f3d5f10..72ee7c7 100644
--- a/linux/crisv10/arch_rt_sigframe.c
+++ b/fetch_indirect_syscall_args.c
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,9 +25,31 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-FUNC_GET_RT_SIGFRAME_ADDR
-{
-	unsigned long addr;
+#include "defs.h"
 
-	return upeek(tcp->pid, 4 * PT_USP, &addr) ? 0 : addr;
+/*
+ * Fetch indirect syscall arguments that are provided as an array.
+ * Return a pointer to a static array of kernel_ulong_t elements,
+ * or NULL in case of fetch failure.
+ */
+kernel_ulong_t *
+fetch_indirect_syscall_args(struct tcb *const tcp,
+			    const kernel_ulong_t addr,
+			    const unsigned int n_args)
+{
+	static kernel_ulong_t u_arg[MAX_ARGS];
+
+	if (current_wordsize == sizeof(*u_arg)) {
+		if (umoven(tcp, addr, sizeof(*u_arg) * n_args, u_arg))
+			return NULL;
+	} else {
+		uint32_t narrow_arg[ARRAY_SIZE(u_arg)];
+
+		if (umoven(tcp, addr, sizeof(*narrow_arg) * n_args, narrow_arg))
+			return NULL;
+		for (unsigned int i = 0; i < n_args; ++i)
+			u_arg[i] = narrow_arg[i];
+	}
+
+	return u_arg;
 }
diff --git a/filter.h b/filter.h
index fab1812..7b63b6d 100644
--- a/filter.h
+++ b/filter.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2017 Nikolay Marchuk <marchuk.nikolay.a@gmail.com>
- * Copyright (c) 2017 The strace developers.
+ * Copyright (c) 2017-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -34,7 +34,6 @@
 
 void qualify_tokens(const char *str, struct number_set *set,
 		    string_to_uint_func func, const char *name);
-void qualify_syscall_tokens(const char *str, struct number_set *set,
-			    const char *name);
+void qualify_syscall_tokens(const char *str, struct number_set *set);
 
 #endif /* !STRACE_FILTER_H */
diff --git a/filter_qualify.c b/filter_qualify.c
index 5b0ef28..49f0d61 100644
--- a/filter_qualify.c
+++ b/filter_qualify.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2016 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2016-2017 The strace developers.
+ * Copyright (c) 2016-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -44,15 +44,13 @@
 static int
 sigstr_to_uint(const char *s)
 {
-	int i;
-
 	if (*s >= '0' && *s <= '9')
 		return string_to_uint_upto(s, 255);
 
 	if (strncasecmp(s, "SIG", 3) == 0)
 		s += 3;
 
-	for (i = 0; i <= 255; ++i) {
+	for (int i = 0; i <= 255; ++i) {
 		const char *name = signame(i);
 
 		if (strncasecmp(name, "SIG", 3) != 0)
@@ -72,9 +70,7 @@
 static int
 find_errno_by_name(const char *name)
 {
-	unsigned int i;
-
-	for (i = 1; i < nerrnos; ++i) {
+	for (unsigned int i = 1; i < nerrnos; ++i) {
 		if (errnoent[i] && (strcasecmp(name, errnoent[i]) == 0))
 			return i;
 	}
@@ -87,7 +83,7 @@
 		   const bool fault_tokens_only)
 {
 	const char *val;
-	int intval;
+	kernel_long_t intval;
 
 	if ((val = STR_STRIP_PREFIX(token, "when=")) != token) {
 		/*
@@ -133,9 +129,23 @@
 		   && (val = STR_STRIP_PREFIX(token, "retval=")) != token) {
 		if (fopts->data.flags & INJECT_F_RETVAL)
 			return false;
-		intval = string_to_uint(val);
+		intval = string_to_kulong(val);
 		if (intval < 0)
 			return false;
+
+#if ANY_WORDSIZE_LESS_THAN_KERNEL_LONG && !HAVE_ARCH_DEDICATED_ERR_REG
+		if ((int) intval != intval)
+			error_msg("Injected return value %" PRI_kld " will be"
+				  " clipped to %d in compat personality",
+				  intval, (int) intval);
+
+		if ((int) intval < 0 && (int) intval >= -MAX_ERRNO_VALUE)
+			error_msg("Inadvertent injection of error %d is"
+				  " possible in compat personality for"
+				  " retval=%" PRI_kld,
+				  -(int) intval, intval);
+#endif
+
 		fopts->data.rval = intval;
 		fopts->data.flags |= INJECT_F_RETVAL;
 	} else if (!fault_tokens_only
@@ -154,30 +164,24 @@
 	return true;
 }
 
-static char *
-parse_inject_expression(const char *const s, char **buf,
+static const char *
+parse_inject_expression(char *const str,
 			struct inject_opts *const fopts,
 			const bool fault_tokens_only)
 {
-	char *saveptr = NULL;
-	char *name = NULL;
-	char *token;
+	if (str[0] == '\0' || str[0] == ':')
+		return "";
 
-	*buf = xstrdup(s);
-	for (token = strtok_r(*buf, ":", &saveptr); token;
-	     token = strtok_r(NULL, ":", &saveptr)) {
-		if (!name)
-			name = token;
-		else if (!parse_inject_token(token, fopts, fault_tokens_only))
-			goto parse_error;
+	char *saveptr = NULL;
+	const char *name = strtok_r(str, ":", &saveptr);
+
+	char *token;
+	while ((token = strtok_r(NULL, ":", &saveptr))) {
+		if (!parse_inject_token(token, fopts, fault_tokens_only))
+			return NULL;
 	}
 
-	if (name)
-		return name;
-
-parse_error:
-	free(*buf);
-	return *buf = NULL;
+	return name;
 }
 
 static void
@@ -209,7 +213,7 @@
 {
 	if (!trace_set)
 		trace_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
-	qualify_syscall_tokens(str, trace_set, "system call");
+	qualify_syscall_tokens(str, trace_set);
 }
 
 static void
@@ -217,7 +221,7 @@
 {
 	if (!abbrev_set)
 		abbrev_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
-	qualify_syscall_tokens(str, abbrev_set, "system call");
+	qualify_syscall_tokens(str, abbrev_set);
 }
 
 static void
@@ -225,7 +229,7 @@
 {
 	if (!verbose_set)
 		verbose_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
-	qualify_syscall_tokens(str, verbose_set, "system call");
+	qualify_syscall_tokens(str, verbose_set);
 }
 
 static void
@@ -233,7 +237,7 @@
 {
 	if (!raw_set)
 		raw_set = alloc_number_set_array(SUPPORTED_PERSONALITIES);
-	qualify_syscall_tokens(str, raw_set, "system call");
+	qualify_syscall_tokens(str, raw_set);
 }
 
 static void
@@ -245,11 +249,17 @@
 		.first = 1,
 		.step = 1
 	};
-	char *buf = NULL;
-	char *name = parse_inject_expression(str, &buf, &opts, fault_tokens_only);
-	if (!name) {
+	char *copy = xstrdup(str);
+	const char *name =
+		parse_inject_expression(copy, &opts, fault_tokens_only);
+	if (!name)
 		error_msg_and_die("invalid %s '%s'", description, str);
-	}
+
+	struct number_set *tmp_set =
+		alloc_number_set_array(SUPPORTED_PERSONALITIES);
+	qualify_syscall_tokens(name, tmp_set);
+
+	free(copy);
 
 	/* If neither of retval, error, or signal is specified, then ... */
 	if (!opts.data.flags) {
@@ -263,18 +273,11 @@
 		}
 	}
 
-	struct number_set *tmp_set =
-		alloc_number_set_array(SUPPORTED_PERSONALITIES);
-	qualify_syscall_tokens(name, tmp_set, description);
-
-	free(buf);
-
 	/*
-	 * Initialize inject_vec accourding to tmp_set.
+	 * Initialize inject_vec according to tmp_set.
 	 * Merge tmp_set into inject_set.
 	 */
-	unsigned int p;
-	for (p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
+	for (unsigned int p = 0; p < SUPPORTED_PERSONALITIES; ++p) {
 		if (number_set_array_is_empty(tmp_set, p))
 			continue;
 
@@ -284,11 +287,10 @@
 		}
 		if (!inject_vec[p]) {
 			inject_vec[p] = xcalloc(nsyscall_vec[p],
-					       sizeof(*inject_vec[p]));
+						sizeof(*inject_vec[p]));
 		}
 
-		unsigned int i;
-		for (i = 0; i < nsyscall_vec[p]; ++i) {
+		for (unsigned int i = 0; i < nsyscall_vec[p]; ++i) {
 			if (is_number_in_set_array(i, tmp_set, p)) {
 				add_number_to_set_array(i, inject_set, p);
 				inject_vec[p][i] = opts;
@@ -340,9 +342,8 @@
 qualify(const char *str)
 {
 	const struct qual_options *opt = qual_options;
-	unsigned int i;
 
-	for (i = 0; i < ARRAY_SIZE(qual_options); ++i) {
+	for (unsigned int i = 0; i < ARRAY_SIZE(qual_options); ++i) {
 		const char *name = qual_options[i].name;
 		const size_t len = strlen(name);
 		const char *val = str_strip_prefix_len(str, name, len);
diff --git a/getpagesize.c b/getpagesize.c
new file mode 100644
index 0000000..49c6234
--- /dev/null
+++ b/getpagesize.c
@@ -0,0 +1,6 @@
+#include "defs.h"
+
+SYS_FUNC(getpagesize)
+{
+	return RVAL_DECODED | RVAL_HEX;
+}
diff --git a/ioctl.c b/ioctl.c
index b61a5be..9fd7492 100644
--- a/ioctl.c
+++ b/ioctl.c
@@ -287,15 +287,21 @@
 		return scsi_ioctl(tcp, code, arg);
 	case 'L':
 		return loop_ioctl(tcp, code, arg);
+#ifdef HAVE_STRUCT_MTD_WRITE_REQ
 	case 'M':
 		return mtd_ioctl(tcp, code, arg);
+#endif
+#ifdef HAVE_STRUCT_UBI_ATTACH_REQ_MAX_BEB_PER1024
 	case 'o':
 	case 'O':
 		return ubi_ioctl(tcp, code, arg);
+#endif
 	case 'V':
 		return v4l2_ioctl(tcp, code, arg);
+#ifdef HAVE_STRUCT_PTP_SYS_OFFSET
 	case '=':
 		return ptp_ioctl(tcp, code, arg);
+#endif
 #ifdef HAVE_LINUX_INPUT_H
 	case 'E':
 		return evdev_ioctl(tcp, code, arg);
@@ -314,6 +320,10 @@
 	case 0xfd:
 		return dm_ioctl(tcp, code, arg);
 #endif
+#ifdef HAVE_LINUX_KVM_H
+	case 0xae:
+		return kvm_ioctl(tcp, code, arg);
+#endif
 	default:
 		break;
 	}
diff --git a/ioctlent0.h b/ioctlent0.h
index 13c2165..7e542b1 100644
--- a/ioctlent0.h
+++ b/ioctlent0.h
@@ -1051,6 +1051,7 @@
 { "DRM_IOCTL_MSM_GEM_CPU_FINI", 0x40046445 },
 { "DRM_IOCTL_RADEON_FULLSCREEN", 0x40046446 },
 { "DRM_IOCTL_MGA_SET_FENCE", 0x4004644a },
+{ "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", 0x4004644b },
 { "DRM_IOCTL_I915_DESTROY_HEAP", 0x4004644c },
 { "DRM_IOCTL_I915_SET_VBLANK_PIPE", 0x4004644d },
 { "DRM_IOCTL_R128_FULLSCREEN", 0x40046450 },
@@ -1403,6 +1404,7 @@
 { "DRM_IOCTL_VIA_PCICMD", 0x4010644a },
 { "DRM_IOCTL_I915_HWS_ADDR", 0x40106451 },
 { "DRM_IOCTL_I915_GEM_INIT", 0x40106453 },
+{ "DRM_IOCTL_AMDGPU_SCHED", 0x40106455 },
 { "DRM_IOCTL_SIS_FB_INIT", 0x40106456 },
 { "DRM_IOCTL_RADEON_SETPARAM", 0x40106459 },
 { "TUNER_SET_CONFIG", 0x4010645c },
@@ -1458,7 +1460,6 @@
 { "DRM_IOCTL_QXL_UPDATE_AREA", 0x40186443 },
 { "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", 0x40186444 },
 { "DRM_IOCTL_MSM_GEM_CPU_PREP", 0x40186444 },
-{ "DRM_IOCTL_MSM_WAIT_FENCE", 0x40186447 },
 { "DRM_IOCTL_R128_BLIT", 0x4018644b },
 { "RIO_MPORT_MAINT_WRITE_LOCAL", 0x40186d06 },
 { "RIO_MPORT_MAINT_WRITE_REMOTE", 0x40186d08 },
@@ -1487,6 +1488,7 @@
 { "DRM_IOCTL_AMDGPU_INFO", 0x40206445 },
 { "DRM_IOCTL_SIS_FB_FREE", 0x40206445 },
 { "DRM_IOCTL_ETNAVIV_WAIT_FENCE", 0x40206447 },
+{ "DRM_IOCTL_MSM_WAIT_FENCE", 0x40206447 },
 { "DRM_IOCTL_RADEON_CLEAR", 0x40206448 },
 { "DRM_IOCTL_ETNAVIV_GEM_WAIT", 0x40206449 },
 { "DRM_IOCTL_I915_CMDBUFFER", 0x4020644b },
@@ -2187,6 +2189,7 @@
 { "DRM_IOCTL_MODE_RMFB", 0xc00464af },
 { "DRM_IOCTL_MODE_DESTROY_DUMB", 0xc00464b4 },
 { "DRM_IOCTL_MODE_DESTROYPROPBLOB", 0xc00464be },
+{ "DRM_IOCTL_MODE_REVOKE_LEASE", 0xc00464c9 },
 { "SNDCTL_MIDI_PRETIME", 0xc0046d00 },
 { "SNDCTL_MIDI_MPUMODE", 0xc0046d01 },
 { "MGSL_IOCWAITEVENT", 0xc0046d08 },
@@ -2274,6 +2277,7 @@
 { "DRM_IOCTL_PRIME_HANDLE_TO_FD", 0xc00c642d },
 { "DRM_IOCTL_PRIME_FD_TO_HANDLE", 0xc00c642e },
 { "DRM_IOCTL_MSM_GEM_MADVISE", 0xc00c6448 },
+{ "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", 0xc00c644a },
 { "DRM_IOCTL_VIA_CMDBUF_SIZE", 0xc00c644b },
 { "DRM_IOCTL_I915_VBLANK_SWAP", 0xc00c644f },
 { "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", 0xc00c6463 },
@@ -2352,6 +2356,7 @@
 { "DRM_IOCTL_TEGRA_GEM_SET_TILING", 0xc010644a },
 { "DRM_IOCTL_VC4_LABEL_BO", 0xc010644a },
 { "DRM_IOCTL_TEGRA_GEM_GET_TILING", 0xc010644b },
+{ "DRM_IOCTL_VC4_GEM_MADVISE", 0xc010644b },
 { "DRM_IOCTL_RADEON_INDIRECT", 0xc010644d },
 { "DRM_IOCTL_R128_INDIRECT", 0xc010644f },
 { "DRM_IOCTL_AMDGPU_GEM_OP", 0xc0106450 },
@@ -2375,6 +2380,8 @@
 { "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", 0xc01064c2 },
 { "DRM_IOCTL_SYNCOBJ_RESET", 0xc01064c4 },
 { "DRM_IOCTL_SYNCOBJ_SIGNAL", 0xc01064c5 },
+{ "DRM_IOCTL_MODE_LIST_LESSEES", 0xc01064c7 },
+{ "DRM_IOCTL_MODE_GET_LEASE", 0xc01064c8 },
 { "MGSL_IOCWAITGPIO", 0xc0106d12 },
 { "NCP_IOC_GETPRIVATEDATA", 0xc0106e0a },
 { "DMX_GET_STC", 0xc0106f32 },
@@ -2420,6 +2427,8 @@
 { "BINDER_GET_NODE_DEBUG_INFO", 0xc018620b },
 { "DRM_IOCTL_MAP_BUFS", 0xc0186419 },
 { "DRM_IOCTL_WAIT_VBLANK", 0xc018643a },
+{ "DRM_IOCTL_CRTC_GET_SEQUENCE", 0xc018643b },
+{ "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", 0xc018643c },
 { "DRM_IOCTL_AMDGPU_BO_LIST", 0xc0186443 },
 { "DRM_IOCTL_AMDGPU_CS", 0xc0186444 },
 { "DRM_IOCTL_I810_GETBUF", 0xc0186445 },
@@ -2444,6 +2453,7 @@
 { "DRM_IOCTL_MODE_PAGE_FLIP", 0xc01864b0 },
 { "DRM_IOCTL_MODE_DIRTYFB", 0xc01864b1 },
 { "DRM_IOCTL_MODE_OBJ_SETPROPERTY", 0xc01864ba },
+{ "DRM_IOCTL_MODE_CREATE_LEASE", 0xc01864c6 },
 { "I2OHRTGET", 0xc0186901 },
 { "I2OLCTGET", 0xc0186902 },
 { "RIO_ALLOC_DMA", 0xc0186d13 },
@@ -2498,6 +2508,7 @@
 { "DRM_IOCTL_AMDGPU_WAIT_CS", 0xc0206449 },
 { "DRM_IOCTL_MGA_DMA_BOOTSTRAP", 0xc020644c },
 { "DRM_IOCTL_RADEON_TEXTURE", 0xc020644e },
+{ "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", 0xc0206454 },
 { "DRM_IOCTL_SIS_AGP_ALLOC", 0xc0206454 },
 { "DRM_IOCTL_RADEON_GEM_CREATE", 0xc020645d },
 { "DRM_IOCTL_RADEON_GEM_MMAP", 0xc020645e },
@@ -2589,6 +2600,7 @@
 { "VIDIOC_ENUMAUDIO", 0xc0345641 },
 { "VIDIOC_ENUMAUDOUT", 0xc0345642 },
 { "VIDIOC_ENUM_FRAMEINTERVALS", 0xc034564b },
+{ "DELL_WMI_SMBIOS_CMD", 0xc0345700 },
 { "MEDIA_IOC_SETUP_LINK", 0xc0347c03 },
 { "SYNC_IOC_FILE_INFO", 0xc0383e04 },
 { "HIDIOCGFIELDINFO", 0xc038480a },
@@ -2600,10 +2612,10 @@
 { "CEC_TRANSMIT", 0xc0386105 },
 { "CEC_RECEIVE", 0xc0386106 },
 { "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", 0xc0386444 },
-{ "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", 0xc0386446 },
 { "DRM_IOCTL_MODE_ATOMIC", 0xc03864bc },
 { "BTRFS_IOC_INO_PATHS", 0xc0389423 },
 { "BTRFS_IOC_LOGICAL_INO", 0xc0389424 },
+{ "BTRFS_IOC_LOGICAL_INO_V2", 0xc038943b },
 { "GENWQE_SLU_UPDATE", 0xc038a550 },
 { "GENWQE_SLU_READ", 0xc038a551 },
 { "PTP_SYS_OFFSET_PRECISE", 0xc0403d08 },
@@ -2638,6 +2650,8 @@
 { "VIDIOC_ENUMOUTPUT", 0xc0485630 },
 { "VIDIOC_DECODER_CMD", 0xc0485660 },
 { "VIDIOC_TRY_DECODER_CMD", 0xc0485661 },
+{ "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", 0xc0486446 },
+{ "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", 0xc048644a },
 { "DRM_IOCTL_MODE_ATTACHMODE", 0xc04864a8 },
 { "DRM_IOCTL_MODE_DETACHMODE", 0xc04864a9 },
 { "VIDEO_COMMAND", 0xc0486f3b },
@@ -2648,6 +2662,7 @@
 { "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", 0xc04c5349 },
 { "VIDIOC_OMAP3ISP_AF_CFG", 0xc04c56c5 },
 { "CEC_ADAP_G_CAPS", 0xc04c6100 },
+{ "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", 0xc04c644b },
 { "NVME_NVM_IOCTL_ADMIN_VIO", 0xc0504c41 },
 { "NVME_NVM_IOCTL_IO_VIO", 0xc0504c43 },
 { "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", 0xc0505350 },
diff --git a/ioctlent1.h b/ioctlent1.h
index f5301b8..6926aa3 100644
--- a/ioctlent1.h
+++ b/ioctlent1.h
@@ -1093,6 +1093,7 @@
 { "DRM_IOCTL_MSM_GEM_CPU_FINI", 0x40046445 },
 { "DRM_IOCTL_RADEON_FULLSCREEN", 0x40046446 },
 { "DRM_IOCTL_MGA_SET_FENCE", 0x4004644a },
+{ "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", 0x4004644b },
 { "DRM_IOCTL_I915_DESTROY_HEAP", 0x4004644c },
 { "DRM_IOCTL_RADEON_STIPPLE", 0x4004644c },
 { "DRM_IOCTL_I915_SET_VBLANK_PIPE", 0x4004644d },
@@ -1445,6 +1446,7 @@
 { "DRM_IOCTL_RADEON_CMDBUF", 0x40106450 },
 { "DRM_IOCTL_I915_HWS_ADDR", 0x40106451 },
 { "DRM_IOCTL_I915_GEM_INIT", 0x40106453 },
+{ "DRM_IOCTL_AMDGPU_SCHED", 0x40106455 },
 { "DRM_IOCTL_SIS_AGP_FREE", 0x40106455 },
 { "DRM_IOCTL_RADEON_SETPARAM", 0x40106459 },
 { "DRM_IOCTL_I915_PERF_OPEN", 0x40106476 },
@@ -1502,7 +1504,6 @@
 { "DRM_IOCTL_QXL_UPDATE_AREA", 0x40186443 },
 { "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", 0x40186444 },
 { "DRM_IOCTL_MSM_GEM_CPU_PREP", 0x40186444 },
-{ "DRM_IOCTL_MSM_WAIT_FENCE", 0x40186447 },
 { "DRM_IOCTL_RADEON_CLEAR", 0x40186448 },
 { "DRM_IOCTL_I915_CMDBUFFER", 0x4018644b },
 { "DRM_IOCTL_R128_BLIT", 0x4018644b },
@@ -1536,6 +1537,7 @@
 { "DRM_IOCTL_VIRTGPU_EXECBUFFER", 0x40206442 },
 { "DRM_IOCTL_AMDGPU_INFO", 0x40206445 },
 { "DRM_IOCTL_ETNAVIV_WAIT_FENCE", 0x40206447 },
+{ "DRM_IOCTL_MSM_WAIT_FENCE", 0x40206447 },
 { "DRM_IOCTL_ETNAVIV_GEM_WAIT", 0x40206449 },
 { "DRM_IOCTL_I915_GEM_PREAD", 0x4020645c },
 { "DRM_IOCTL_I915_GEM_PWRITE", 0x4020645d },
@@ -2251,6 +2253,7 @@
 { "DRM_IOCTL_MODE_RMFB", 0xc00464af },
 { "DRM_IOCTL_MODE_DESTROY_DUMB", 0xc00464b4 },
 { "DRM_IOCTL_MODE_DESTROYPROPBLOB", 0xc00464be },
+{ "DRM_IOCTL_MODE_REVOKE_LEASE", 0xc00464c9 },
 { "I8K_GET_SPEED", 0xc0046985 },
 { "I8K_GET_FAN", 0xc0046986 },
 { "I8K_SET_FAN", 0xc0046987 },
@@ -2350,6 +2353,7 @@
 { "DRM_IOCTL_PRIME_HANDLE_TO_FD", 0xc00c642d },
 { "DRM_IOCTL_PRIME_FD_TO_HANDLE", 0xc00c642e },
 { "DRM_IOCTL_MSM_GEM_MADVISE", 0xc00c6448 },
+{ "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", 0xc00c644a },
 { "DRM_IOCTL_VIA_CMDBUF_SIZE", 0xc00c644b },
 { "DRM_IOCTL_I915_VBLANK_SWAP", 0xc00c644f },
 { "DRM_IOCTL_RADEON_GEM_SET_DOMAIN", 0xc00c6463 },
@@ -2426,6 +2430,7 @@
 { "DRM_IOCTL_TEGRA_GEM_SET_TILING", 0xc010644a },
 { "DRM_IOCTL_VC4_LABEL_BO", 0xc010644a },
 { "DRM_IOCTL_TEGRA_GEM_GET_TILING", 0xc010644b },
+{ "DRM_IOCTL_VC4_GEM_MADVISE", 0xc010644b },
 { "DRM_IOCTL_RADEON_INDIRECT", 0xc010644d },
 { "DRM_IOCTL_VIA_WAIT_IRQ", 0xc010644d },
 { "DRM_IOCTL_R128_INDIRECT", 0xc010644f },
@@ -2449,6 +2454,8 @@
 { "DRM_IOCTL_SYNCOBJ_FD_TO_HANDLE", 0xc01064c2 },
 { "DRM_IOCTL_SYNCOBJ_RESET", 0xc01064c4 },
 { "DRM_IOCTL_SYNCOBJ_SIGNAL", 0xc01064c5 },
+{ "DRM_IOCTL_MODE_LIST_LESSEES", 0xc01064c7 },
+{ "DRM_IOCTL_MODE_GET_LEASE", 0xc01064c8 },
 { "MGSL_IOCWAITGPIO", 0xc0106d12 },
 { "DMX_GET_STC", 0xc0106f32 },
 { "SCIF_ACCEPTREQ", 0xc0107304 },
@@ -2498,6 +2505,8 @@
 { "DRM_IOCTL_GET_CLIENT", 0xc0186405 },
 { "DRM_IOCTL_ADD_MAP", 0xc0186415 },
 { "DRM_IOCTL_ADD_BUFS", 0xc0186416 },
+{ "DRM_IOCTL_CRTC_GET_SEQUENCE", 0xc018643b },
+{ "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", 0xc018643c },
 { "DRM_IOCTL_AMDGPU_BO_LIST", 0xc0186443 },
 { "DRM_IOCTL_AMDGPU_CS", 0xc0186444 },
 { "DRM_IOCTL_VC4_CREATE_SHADER_BO", 0xc0186445 },
@@ -2519,6 +2528,7 @@
 { "DRM_IOCTL_MODE_PAGE_FLIP", 0xc01864b0 },
 { "DRM_IOCTL_MODE_DIRTYFB", 0xc01864b1 },
 { "DRM_IOCTL_MODE_OBJ_SETPROPERTY", 0xc01864ba },
+{ "DRM_IOCTL_MODE_CREATE_LEASE", 0xc01864c6 },
 { "I2OPARMSET", 0xc0186903 },
 { "I2OPARMGET", 0xc0186904 },
 { "IPMICTL_RECEIVE_MSG_TRUNC", 0xc018690b },
@@ -2573,6 +2583,7 @@
 { "SNDRV_RAWMIDI_IOCTL_PARAMS", 0xc0205710 },
 { "DRM_IOCTL_AMDGPU_GEM_CREATE", 0xc0206440 },
 { "DRM_IOCTL_AMDGPU_WAIT_CS", 0xc0206449 },
+{ "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", 0xc0206454 },
 { "DRM_IOCTL_RADEON_GEM_CREATE", 0xc020645d },
 { "DRM_IOCTL_RADEON_GEM_MMAP", 0xc020645e },
 { "DRM_IOCTL_RADEON_GEM_PREAD", 0xc0206461 },
@@ -2652,6 +2663,7 @@
 { "VIDIOC_ENUMAUDIO", 0xc0345641 },
 { "VIDIOC_ENUMAUDOUT", 0xc0345642 },
 { "VIDIOC_ENUM_FRAMEINTERVALS", 0xc034564b },
+{ "DELL_WMI_SMBIOS_CMD", 0xc0345700 },
 { "MEDIA_IOC_SETUP_LINK", 0xc0347c03 },
 { "SYNC_IOC_FILE_INFO", 0xc0383e04 },
 { "HIDIOCGFIELDINFO", 0xc038480a },
@@ -2661,10 +2673,10 @@
 { "CEC_TRANSMIT", 0xc0386105 },
 { "CEC_RECEIVE", 0xc0386106 },
 { "DRM_IOCTL_VIRTGPU_RESOURCE_CREATE", 0xc0386444 },
-{ "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", 0xc0386446 },
 { "DRM_IOCTL_MODE_ATOMIC", 0xc03864bc },
 { "BTRFS_IOC_INO_PATHS", 0xc0389423 },
 { "BTRFS_IOC_LOGICAL_INO", 0xc0389424 },
+{ "BTRFS_IOC_LOGICAL_INO_V2", 0xc038943b },
 { "GENWQE_SLU_UPDATE", 0xc038a550 },
 { "GENWQE_SLU_READ", 0xc038a551 },
 { "VIDIOC_OMAP3ISP_PRV_CFG", 0xc03c56c2 },
@@ -2705,6 +2717,8 @@
 { "VIDIOC_ENUMOUTPUT", 0xc0485630 },
 { "VIDIOC_DECODER_CMD", 0xc0485660 },
 { "VIDIOC_TRY_DECODER_CMD", 0xc0485661 },
+{ "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", 0xc0486446 },
+{ "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", 0xc048644a },
 { "DRM_IOCTL_MODE_ATTACHMODE", 0xc04864a8 },
 { "DRM_IOCTL_MODE_DETACHMODE", 0xc04864a9 },
 { "VIDEO_COMMAND", 0xc0486f3b },
@@ -2715,6 +2729,7 @@
 { "SNDRV_SEQ_IOCTL_GET_QUEUE_CLIENT", 0xc04c5349 },
 { "VIDIOC_OMAP3ISP_AF_CFG", 0xc04c56c5 },
 { "CEC_ADAP_G_CAPS", 0xc04c6100 },
+{ "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", 0xc04c644b },
 { "NVME_NVM_IOCTL_ADMIN_VIO", 0xc0504c41 },
 { "NVME_NVM_IOCTL_IO_VIO", 0xc0504c43 },
 { "SNDRV_SEQ_IOCTL_GET_SUBSCRIPTION", 0xc0505350 },
diff --git a/ioprio.c b/ioprio.c
index 682a7b3..9ef2a32 100644
--- a/ioprio.c
+++ b/ioprio.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2014-2017 The strace developers.
+ * Copyright (c) 2014-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -27,6 +27,7 @@
  */
 
 #include "defs.h"
+#include "xstring.h"
 
 enum {
 	IOPRIO_WHO_PROCESS = 1,
@@ -62,10 +63,10 @@
 	data = IOPRIO_PRIO_DATA(ioprio);
 	str = xlookup(ioprio_class, class);
 	if (str)
-		sprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data);
+		xsprintf(outstr, "IOPRIO_PRIO_VALUE(%s, %d)", str, data);
 	else
-		sprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)",
-			class, "IOPRIO_CLASS_???", data);
+		xsprintf(outstr, "IOPRIO_PRIO_VALUE(%#x /* %s */, %d)",
+			 class, "IOPRIO_CLASS_???", data);
 
 	return outstr;
 }
diff --git a/ipc_shm.c b/ipc_shm.c
index 7284b18..b358fc6 100644
--- a/ipc_shm.c
+++ b/ipc_shm.c
@@ -39,6 +39,14 @@
 # include <linux/shm.h>
 #endif
 
+#ifndef SHM_HUGE_SHIFT
+# define SHM_HUGE_SHIFT 26
+#endif
+
+#ifndef SHM_HUGE_MASK
+# define SHM_HUGE_MASK 0x3f
+#endif
+
 #include "xlat/shm_resource_flags.h"
 #include "xlat/shm_flags.h"
 
@@ -50,9 +58,24 @@
 	else
 		tprints("IPC_PRIVATE");
 	tprintf(", %" PRI_klu ", ", tcp->u_arg[1]);
-	if (printflags(shm_resource_flags, tcp->u_arg[2] & ~0777, NULL) != 0)
+
+	unsigned int flags = tcp->u_arg[2] & ~0777;
+	const unsigned int mask = SHM_HUGE_MASK << SHM_HUGE_SHIFT;
+	const unsigned int hugetlb_value = flags & mask;
+
+	flags &= ~mask;
+	if (flags || !hugetlb_value)
+		printflags(shm_resource_flags, flags, NULL);
+
+	if (hugetlb_value)
+		tprintf("%s%u<<SHM_HUGE_SHIFT",
+			flags ? "|" : "",
+			hugetlb_value >> SHM_HUGE_SHIFT);
+
+	if (flags || hugetlb_value)
 		tprints("|");
 	print_numeric_umode_t(tcp->u_arg[2] & 0777);
+
 	return RVAL_DECODED;
 }
 
diff --git a/kvm.c b/kvm.c
new file mode 100644
index 0000000..86fd9e5
--- /dev/null
+++ b/kvm.c
@@ -0,0 +1,140 @@
+/*
+ * Support for decoding of KVM_* ioctl commands.
+ *
+ * Copyright (c) 2017 Masatake YAMATO <yamato@redhat.com>
+ * Copyright (c) 2017 Red Hat, Inc.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "defs.h"
+
+#ifdef HAVE_LINUX_KVM_H
+# include <linux/kvm.h>
+# include "print_fields.h"
+# include "arch_kvm.c"
+
+static int
+kvm_ioctl_create_vcpu(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+	uint32_t cpuid = arg;
+
+	tprintf(", %u", cpuid);
+	return RVAL_IOCTL_DECODED | RVAL_FD;
+}
+
+# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION
+#  include "xlat/kvm_mem_flags.h"
+static int
+kvm_ioctl_set_user_memory_region(struct tcb *const tcp, const kernel_ulong_t arg)
+{
+	struct kvm_userspace_memory_region u_memory_region;
+
+	tprints(", ");
+	if (umove_or_printaddr(tcp, arg, &u_memory_region))
+		return RVAL_IOCTL_DECODED;
+
+	PRINT_FIELD_U("{", u_memory_region, slot);
+	PRINT_FIELD_FLAGS(", ", u_memory_region, flags, kvm_mem_flags,
+			  "KVM_MEM_???");
+	PRINT_FIELD_X(", ", u_memory_region, guest_phys_addr);
+	PRINT_FIELD_U(", ", u_memory_region, memory_size);
+	PRINT_FIELD_X(", ", u_memory_region, userspace_addr);
+	tprints("}");
+
+	return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION */
+
+# ifdef HAVE_STRUCT_KVM_REGS
+static int
+kvm_ioctl_decode_regs(struct tcb *const tcp, const unsigned int code,
+		      const kernel_ulong_t arg)
+{
+	struct kvm_regs regs;
+
+	if (code == KVM_GET_REGS && entering(tcp))
+		return 0;
+
+	tprints(", ");
+	if (!umove_or_printaddr(tcp, arg, &regs))
+		arch_print_kvm_regs(tcp, arg, &regs);
+
+	return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_REGS */
+
+# ifdef HAVE_STRUCT_KVM_SREGS
+static int
+kvm_ioctl_decode_sregs(struct tcb *const tcp, const unsigned int code,
+		       const kernel_ulong_t arg)
+{
+	struct kvm_sregs sregs;
+
+	if (code == KVM_GET_SREGS && entering(tcp))
+		return 0;
+
+	tprints(", ");
+	if (!umove_or_printaddr(tcp, arg, &sregs))
+		arch_print_kvm_sregs(tcp, arg, &sregs);
+
+	return RVAL_IOCTL_DECODED;
+}
+# endif /* HAVE_STRUCT_KVM_SREGS */
+
+int
+kvm_ioctl(struct tcb *const tcp, const unsigned int code, const kernel_ulong_t arg)
+{
+	switch (code) {
+	case KVM_CREATE_VCPU:
+		return kvm_ioctl_create_vcpu(tcp, arg);
+
+# ifdef HAVE_STRUCT_KVM_USERSPACE_MEMORY_REGION
+	case KVM_SET_USER_MEMORY_REGION:
+		return kvm_ioctl_set_user_memory_region(tcp, arg);
+# endif
+
+# ifdef HAVE_STRUCT_KVM_REGS
+	case KVM_SET_REGS:
+	case KVM_GET_REGS:
+		return kvm_ioctl_decode_regs(tcp, code, arg);
+# endif
+
+# ifdef HAVE_STRUCT_KVM_SREGS
+	case KVM_SET_SREGS:
+	case KVM_GET_SREGS:
+		return kvm_ioctl_decode_sregs(tcp, code, arg);
+# endif
+
+	case KVM_CREATE_VM:
+		return RVAL_DECODED | RVAL_FD;
+	case KVM_RUN:
+	case KVM_GET_VCPU_MMAP_SIZE:
+	case KVM_GET_API_VERSION:
+	default:
+		return RVAL_DECODED;
+	}
+}
+
+#endif /* HAVE_LINUX_KVM_H */
diff --git a/linux/crisv10/arch_rt_sigframe.c b/largefile_wrappers.h
similarity index 61%
copy from linux/crisv10/arch_rt_sigframe.c
copy to largefile_wrappers.h
index f3d5f10..6bb11a3 100644
--- a/linux/crisv10/arch_rt_sigframe.c
+++ b/largefile_wrappers.h
@@ -1,5 +1,8 @@
 /*
- * Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
+ * Wrappers for handling discrepancies in LF64-themed syscalls availability and
+ * necessity between verious architectures and kernel veriosns.
+ *
+ * Copyright (c) 2012-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -25,9 +28,31 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 
-FUNC_GET_RT_SIGFRAME_ADDR
-{
-	unsigned long addr;
+#ifndef STRACE_LARGEFILE_WRAPPERS_H
+#define STRACE_LARGEFILE_WRAPPERS_H
 
-	return upeek(tcp->pid, 4 * PT_USP, &addr) ? 0 : addr;
-}
+#include "defs.h"
+
+#ifdef _LARGEFILE64_SOURCE
+# ifdef HAVE_FOPEN64
+#  define fopen_for_output fopen64
+# else
+#  define fopen_for_output fopen
+# endif
+# define struct_stat struct stat64
+# define stat_file stat64
+# define struct_dirent struct dirent64
+# define read_dir readdir64
+# define struct_rlimit struct rlimit64
+# define set_rlimit setrlimit64
+#else
+# define fopen_for_output fopen
+# define struct_stat struct stat
+# define stat_file stat
+# define struct_dirent struct dirent
+# define read_dir readdir
+# define struct_rlimit struct rlimit
+# define set_rlimit setrlimit
+#endif
+
+#endif /* STRACE_LARGEFILE_WRAPPERS_H */
diff --git a/ldt.c b/ldt.c
index 81bc8ae..682847e 100644
--- a/ldt.c
+++ b/ldt.c
@@ -6,7 +6,7 @@
  * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
  * Copyright (c) 2010 Andreas Schwab <schwab@linux-m68k.org>
  * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2014-2017 The strace developers.
+ * Copyright (c) 2014-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -38,50 +38,130 @@
 
 # include <asm/ldt.h>
 
+# include "print_fields.h"
+# include "xstring.h"
+
 void
-print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr)
+print_user_desc(struct tcb *const tcp, const kernel_ulong_t addr,
+		enum user_desc_print_filter filter)
 {
 	struct user_desc desc;
+	unsigned *entry_number = get_tcb_priv_data(tcp);
 
-	if (umove_or_printaddr(tcp, addr, &desc))
-		return;
+	switch (filter) {
+	case USER_DESC_ENTERING:
+		if (umove_or_printaddr(tcp, addr, &desc.entry_number))
+			return;
 
-	tprintf("{entry_number:%d, "
-		"base_addr:%#08x, "
-		"limit:%d, "
-		"seg_32bit:%d, "
-		"contents:%d, "
-		"read_exec_only:%d, "
-		"limit_in_pages:%d, "
-		"seg_not_present:%d, "
-		"useable:%d}",
-		desc.entry_number,
-		desc.base_addr,
-		desc.limit,
-		desc.seg_32bit,
-		desc.contents,
-		desc.read_exec_only,
-		desc.limit_in_pages,
-		desc.seg_not_present,
-		desc.useable);
+		break;
+
+	case USER_DESC_EXITING:
+		if (!addr || !verbose(tcp))
+			return;
+		if (syserror(tcp) || umove(tcp, addr, &desc)) {
+			if (entry_number)
+				tprints(", ...}");
+
+			return;
+		}
+
+		break;
+
+	case USER_DESC_BOTH:
+		if (umove_or_printaddr(tcp, addr, &desc))
+			return;
+
+		break;
+	}
+
+	if (filter & USER_DESC_ENTERING) {
+		PRINT_FIELD_ID("{", desc, entry_number);
+
+		/*
+		 * If we don't print the whole structure now, let's save it for
+		 * later.
+		 */
+		if (filter == USER_DESC_ENTERING) {
+			entry_number = xmalloc(sizeof(*entry_number));
+
+			*entry_number = desc.entry_number;
+			set_tcb_priv_data(tcp, entry_number, free);
+		}
+	}
+
+	if (filter & USER_DESC_EXITING) {
+		/*
+		 * It should be the same in case of get_thread_area, but we can
+		 * never be sure...
+		 */
+		if (filter == USER_DESC_EXITING) {
+			if (entry_number) {
+				if (*entry_number != desc.entry_number) {
+					if ((int) desc.entry_number == -1)
+						tprints(" => -1");
+					else
+						tprintf(" => %u",
+							desc.entry_number);
+				}
+			} else {
+				/*
+				 * This is really strange. If we are here, it
+				 * means that we failed on entering but somehow
+				 * succeeded on exiting.
+				 */
+				PRINT_FIELD_ID(" => {", desc, entry_number);
+			}
+		}
+
+		PRINT_FIELD_0X(", ", desc, base_addr);
+		PRINT_FIELD_0X(", ", desc, limit);
+		PRINT_FIELD_U_CAST(", ", desc, seg_32bit, unsigned int);
+		PRINT_FIELD_U_CAST(", ", desc, contents, unsigned int);
+		PRINT_FIELD_U_CAST(", ", desc, read_exec_only, unsigned int);
+		PRINT_FIELD_U_CAST(", ", desc, limit_in_pages, unsigned int);
+		PRINT_FIELD_U_CAST(", ", desc, seg_not_present, unsigned int);
+		PRINT_FIELD_U_CAST(", ", desc, useable, unsigned int);
+
+# ifdef HAVE_STRUCT_USER_DESC_LM
+		/* lm is totally ignored for 32-bit processes */
+		if (current_klongsize == 8)
+			PRINT_FIELD_U_CAST(", ", desc, lm, unsigned int);
+# endif /* HAVE_STRUCT_USER_DESC_LM */
+
+		tprints("}");
+	}
 }
 
 SYS_FUNC(modify_ldt)
 {
-	tprintf("%" PRI_kld ", ", tcp->u_arg[0]);
-	if (tcp->u_arg[2] != sizeof(struct user_desc))
-		printaddr(tcp->u_arg[1]);
-	else
-		print_user_desc(tcp, tcp->u_arg[1]);
-	tprintf(", %" PRI_klu, tcp->u_arg[2]);
+	if (entering(tcp)) {
+		tprintf("%d, ", (int) tcp->u_arg[0]);
+		if (tcp->u_arg[2] != sizeof(struct user_desc))
+			printaddr(tcp->u_arg[1]);
+		else
+			print_user_desc(tcp, tcp->u_arg[1], USER_DESC_BOTH);
+		tprintf(", %" PRI_klu, tcp->u_arg[2]);
 
-	return RVAL_DECODED;
+		return 0;
+	}
+
+	/*
+	 * For some reason ("tht ABI for sys_modify_ldt() expects
+	 * 'int'"), modify_ldt clips higher bits on x86_64.
+	 */
+
+	if (syserror(tcp) || (kernel_ulong_t) tcp->u_rval < 0xfffff000)
+		return 0;
+
+	tcp->u_error = -(unsigned int) tcp->u_rval;
+
+	return RVAL_PRINT_ERR_VAL;
 }
 
 SYS_FUNC(set_thread_area)
 {
 	if (entering(tcp)) {
-		print_user_desc(tcp, tcp->u_arg[0]);
+		print_user_desc(tcp, tcp->u_arg[0], USER_DESC_BOTH);
 	} else {
 		struct user_desc desc;
 
@@ -91,7 +171,7 @@
 		} else {
 			static char outstr[32];
 
-			sprintf(outstr, "entry_number:%d", desc.entry_number);
+			xsprintf(outstr, "entry_number=%u", desc.entry_number);
 			tcp->auxstr = outstr;
 			return RVAL_STR;
 		}
@@ -101,8 +181,8 @@
 
 SYS_FUNC(get_thread_area)
 {
-	if (exiting(tcp))
-		print_user_desc(tcp, tcp->u_arg[0]);
+	print_user_desc(tcp, tcp->u_arg[0],
+			entering(tcp) ? USER_DESC_ENTERING : USER_DESC_EXITING);
 	return 0;
 }
 
diff --git a/linux/32/ioctls_inc_align16.h b/linux/32/ioctls_inc_align16.h
index 175f85f..1994589 100644
--- a/linux/32/ioctls_inc_align16.h
+++ b/linux/32/ioctls_inc_align16.h
@@ -85,6 +85,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
 { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
 { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
 { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
 { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
 { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4a },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -302,9 +312,11 @@
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
 { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
 { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
 { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
 { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
 { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
 { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
 { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
 { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
 { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/32/ioctls_inc_align32.h b/linux/32/ioctls_inc_align32.h
index 165912a..e8ee3f0 100644
--- a/linux/32/ioctls_inc_align32.h
+++ b/linux/32/ioctls_inc_align32.h
@@ -85,6 +85,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x11c },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
 { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
 { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
 { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
 { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x14 },
 { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -302,9 +312,11 @@
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x6448, 0x0c },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x24 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x1c },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
 { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
 { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
 { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
 { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
 { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
 { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
 { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
 { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
 { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/32/ioctls_inc_align64.h b/linux/32/ioctls_inc_align64.h
index 25de6ba..fd8f575 100644
--- a/linux/32/ioctls_inc_align64.h
+++ b/linux/32/ioctls_inc_align64.h
@@ -85,6 +85,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
 { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x28 },
 { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
 { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
 { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -304,7 +314,9 @@
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
 { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
 { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
 { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
 { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
 { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
 { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
 { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
 { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
 { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
index df25e89..b53bf88 100644
--- a/linux/32/syscallent.h
+++ b/linux/32/syscallent.h
@@ -177,20 +177,20 @@
 [169] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [170] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
 [171] = { 1,	0,		SEN(adjtimex),			"adjtimex"		},
-[172] = { 0,	NF,		SEN(getpid),			"getpid"		},
-[173] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[174] = { 0,	NF,		SEN(getuid),			"getuid"		},
-[175] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[176] = { 0,	NF,		SEN(getgid),			"getgid"		},
-[177] = { 0,	NF,		SEN(getegid),			"getegid"		},
-[178] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[172] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
+[173] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[174] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
+[175] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[176] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
+[177] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[178] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
-[180] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[180] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [181] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[182] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[183] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[184] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[185] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[182] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[183] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[184] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[185] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [186] = { 2,	TI,		SEN(msgget),			"msgget"		},
 [187] = { 3,	TI,		SEN(msgctl),			"msgctl"		},
 [188] = { 5,	TI,		SEN(msgrcv),			"msgrcv"		},
diff --git a/linux/64/ioctls_inc.h b/linux/64/ioctls_inc.h
index 691b6ea..0bc1c76 100644
--- a/linux/64/ioctls_inc.h
+++ b/linux/64/ioctls_inc.h
@@ -85,6 +85,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_BO_LIST", _IOC_READ|_IOC_WRITE, 0x6443, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CS", _IOC_READ|_IOC_WRITE, 0x6444, 0x18 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_CTX", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_FENCE_TO_HANDLE", _IOC_READ|_IOC_WRITE, 0x6454, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_CREATE", _IOC_READ|_IOC_WRITE, 0x6440, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_METADATA", _IOC_READ|_IOC_WRITE, 0x6446, 0x120 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_MMAP", _IOC_READ|_IOC_WRITE, 0x6441, 0x08 },
@@ -93,6 +94,7 @@
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_VA", _IOC_WRITE, 0x6448, 0x28 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_GEM_WAIT_IDLE", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_INFO", _IOC_WRITE, 0x6445, 0x20 },
+{ "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_SCHED", _IOC_WRITE, 0x6455, 0x10 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_VM", _IOC_READ|_IOC_WRITE, 0x6453, 0x08 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_CS", _IOC_READ|_IOC_WRITE, 0x6449, 0x20 },
 { "drm/amdgpu_drm.h", "DRM_IOCTL_AMDGPU_WAIT_FENCES", _IOC_READ|_IOC_WRITE, 0x6452, 0x18 },
@@ -111,6 +113,8 @@
 { "drm/drm.h", "DRM_IOCTL_AUTH_MAGIC", _IOC_WRITE, 0x6411, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_BLOCK", _IOC_READ|_IOC_WRITE, 0x6412, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_CONTROL", _IOC_WRITE, 0x6414, 0x08 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_GET_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643b, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_CRTC_QUEUE_SEQUENCE", _IOC_READ|_IOC_WRITE, 0x643c, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_DMA", _IOC_READ|_IOC_WRITE, 0x6429, 0x40 },
 { "drm/drm.h", "DRM_IOCTL_DROP_MASTER", _IOC_NONE, 0x641f, 0x00 },
 { "drm/drm.h", "DRM_IOCTL_FINISH", _IOC_WRITE, 0x642c, 0x08 },
@@ -138,6 +142,7 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_ATTACHMODE", _IOC_READ|_IOC_WRITE, 0x64a8, 0x48 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATEPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64bd, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CREATE_DUMB", _IOC_READ|_IOC_WRITE, 0x64b2, 0x20 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_CREATE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c6, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR", _IOC_READ|_IOC_WRITE, 0x64a3, 0x1c },
 { "drm/drm.h", "DRM_IOCTL_MODE_CURSOR2", _IOC_READ|_IOC_WRITE, 0x64bb, 0x24 },
 { "drm/drm.h", "DRM_IOCTL_MODE_DESTROYPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64be, 0x04 },
@@ -154,10 +159,13 @@
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPBLOB", _IOC_READ|_IOC_WRITE, 0x64ac, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64aa, 0x40 },
 { "drm/drm.h", "DRM_IOCTL_MODE_GETRESOURCES", _IOC_READ|_IOC_WRITE, 0x64a0, 0x40 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_GET_LEASE", _IOC_READ|_IOC_WRITE, 0x64c8, 0x10 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_LIST_LESSEES", _IOC_READ|_IOC_WRITE, 0x64c7, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_MAP_DUMB", _IOC_READ|_IOC_WRITE, 0x64b3, 0x10 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_GETPROPERTIES", _IOC_READ|_IOC_WRITE, 0x64b9, 0x20 },
 { "drm/drm.h", "DRM_IOCTL_MODE_OBJ_SETPROPERTY", _IOC_READ|_IOC_WRITE, 0x64ba, 0x18 },
 { "drm/drm.h", "DRM_IOCTL_MODE_PAGE_FLIP", _IOC_READ|_IOC_WRITE, 0x64b0, 0x18 },
+{ "drm/drm.h", "DRM_IOCTL_MODE_REVOKE_LEASE", _IOC_READ|_IOC_WRITE, 0x64c9, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_RMFB", _IOC_READ|_IOC_WRITE, 0x64af, 0x04 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETCRTC", _IOC_READ|_IOC_WRITE, 0x64a2, 0x68 },
 { "drm/drm.h", "DRM_IOCTL_MODE_SETGAMMA", _IOC_READ|_IOC_WRITE, 0x64a5, 0x20 },
@@ -195,10 +203,12 @@
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_CPU_PREP", _IOC_WRITE, 0x6444, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
-{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x38 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x48 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_USERPTR", _IOC_READ|_IOC_WRITE, 0x6448, 0x18 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GEM_WAIT", _IOC_WRITE, 0x6449, 0x20 },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_DOM", _IOC_READ|_IOC_WRITE, 0x644a, 0x48 },
+{ "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_PM_QUERY_SIG", _IOC_READ|_IOC_WRITE, 0x644b, 0x4c },
 { "drm/etnaviv_drm.h", "DRM_IOCTL_ETNAVIV_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_EXEC", _IOC_READ|_IOC_WRITE, 0x6462, 0x08 },
 { "drm/exynos_drm.h", "DRM_IOCTL_EXYNOS_G2D_GET_VER", _IOC_READ|_IOC_WRITE, 0x6460, 0x08 },
@@ -304,7 +314,9 @@
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_NEW", _IOC_READ|_IOC_WRITE, 0x6442, 0x10 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GEM_SUBMIT", _IOC_READ|_IOC_WRITE, 0x6446, 0x28 },
 { "drm/msm_drm.h", "DRM_IOCTL_MSM_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6440, 0x10 },
-{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x18 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_CLOSE", _IOC_WRITE, 0x644b, 0x04 },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_SUBMITQUEUE_NEW", _IOC_READ|_IOC_WRITE, 0x644a, 0x0c },
+{ "drm/msm_drm.h", "DRM_IOCTL_MSM_WAIT_FENCE", _IOC_WRITE, 0x6447, 0x20 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_FINI", _IOC_WRITE, 0x6483, 0x04 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_CPU_PREP", _IOC_WRITE, 0x6482, 0x08 },
 { "drm/nouveau_drm.h", "DRM_IOCTL_NOUVEAU_GEM_INFO", _IOC_READ|_IOC_WRITE, 0x6484, 0x28 },
@@ -408,6 +420,7 @@
 { "drm/tegra_drm.h", "DRM_IOCTL_TEGRA_SYNCPT_WAIT", _IOC_READ|_IOC_WRITE, 0x6444, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_BO", _IOC_READ|_IOC_WRITE, 0x6443, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_CREATE_SHADER_BO", _IOC_READ|_IOC_WRITE, 0x6445, 0x18 },
+{ "drm/vc4_drm.h", "DRM_IOCTL_VC4_GEM_MADVISE", _IOC_READ|_IOC_WRITE, 0x644b, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_HANG_STATE", _IOC_READ|_IOC_WRITE, 0x6446, 0xa0 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_PARAM", _IOC_READ|_IOC_WRITE, 0x6447, 0x10 },
 { "drm/vc4_drm.h", "DRM_IOCTL_VC4_GET_TILING", _IOC_READ|_IOC_WRITE, 0x6449, 0x10 },
@@ -606,6 +619,7 @@
 { "linux/btrfs.h", "BTRFS_IOC_INO_LOOKUP", _IOC_READ|_IOC_WRITE, 0x9412, 0x1000 },
 { "linux/btrfs.h", "BTRFS_IOC_INO_PATHS", _IOC_READ|_IOC_WRITE, 0x9423, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO", _IOC_READ|_IOC_WRITE, 0x9424, 0x38 },
+{ "linux/btrfs.h", "BTRFS_IOC_LOGICAL_INO_V2", _IOC_READ|_IOC_WRITE, 0x943b, 0x38 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_ASSIGN", _IOC_WRITE, 0x9429, 0x18 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_CREATE", _IOC_WRITE, 0x942a, 0x10 },
 { "linux/btrfs.h", "BTRFS_IOC_QGROUP_LIMIT", _IOC_READ, 0x942b, 0x30 },
@@ -2400,6 +2414,7 @@
 { "linux/wireless.h", "SIOCSIWSTATS", 0, 0x8B0E, 0 },
 { "linux/wireless.h", "SIOCSIWTHRSPY", 0, 0x8B12, 0 },
 { "linux/wireless.h", "SIOCSIWTXPOW", 0, 0x8B26, 0 },
+{ "linux/wmi.h", "DELL_WMI_SMBIOS_CMD", _IOC_READ|_IOC_WRITE, 0x5700, 0x34 },
 { "media/drv-intf/exynos-fimc.h", "S5P_FIMC_TX_END_NOTIFY", _IOC_NONE, 0x6500, 0x00 },
 { "media/i2c/adv7842.h", "ADV7842_CMD_RAM_TEST", _IOC_NONE, 0x56c0, 0x00 },
 { "media/i2c/bt819.h", "BT819_FIFO_RESET_HIGH", _IOC_NONE, 0x6201, 0x00 },
diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h
index a5ab193..241d944 100644
--- a/linux/64/syscallent.h
+++ b/linux/64/syscallent.h
@@ -170,20 +170,20 @@
 [169] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [170] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
 [171] = { 1,	0,		SEN(adjtimex),			"adjtimex"		},
-[172] = { 0,	NF,		SEN(getpid),			"getpid"		},
-[173] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[174] = { 0,	NF,		SEN(getuid),			"getuid"		},
-[175] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[176] = { 0,	NF,		SEN(getgid),			"getgid"		},
-[177] = { 0,	NF,		SEN(getegid),			"getegid"		},
-[178] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[172] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
+[173] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[174] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
+[175] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[176] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
+[177] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
+[178] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
-[180] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[180] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [181] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[182] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[183] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[184] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[185] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[182] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[183] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[184] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[185] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [186] = { 2,	TI,		SEN(msgget),			"msgget"		},
 [187] = { 3,	TI,		SEN(msgctl),			"msgctl"		},
 [188] = { 5,	TI,		SEN(msgrcv),			"msgrcv"		},
diff --git a/linux/aarch64/arch_defs_.h b/linux/aarch64/arch_defs_.h
new file mode 100644
index 0000000..40232fd
--- /dev/null
+++ b/linux/aarch64/arch_defs_.h
@@ -0,0 +1,4 @@
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
diff --git a/linux/aarch64/arch_regs.c b/linux/aarch64/arch_regs.c
index 5d805fb..234d8c3 100644
--- a/linux/aarch64/arch_regs.c
+++ b/linux/aarch64/arch_regs.c
@@ -36,3 +36,6 @@
 #define ARCH_REGS_FOR_GETREGSET arm_regs_union
 #define ARCH_IOVEC_FOR_GETREGSET aarch64_io
 #define ARCH_PC_REG ((aarch64_io.iov_len == sizeof(arm_regs)) ? arm_regs.ARM_pc : aarch64_regs.pc)
+
+#define ARCH_PERSONALITY_0_IOV_SIZE sizeof(aarch64_regs)
+#define ARCH_PERSONALITY_1_IOV_SIZE sizeof(arm_regs)
diff --git a/linux/aarch64/get_scno.c b/linux/aarch64/get_scno.c
index 569aea0..350f32f 100644
--- a/linux/aarch64/get_scno.c
+++ b/linux/aarch64/get_scno.c
@@ -8,14 +8,11 @@
 		case sizeof(aarch64_regs):
 			/* We are in 64-bit mode */
 			scno = aarch64_regs.regs[8];
-			update_personality(tcp, 0);
 			break;
 		case sizeof(arm_regs):
 			/* We are in 32-bit mode */
 			/* Note: we don't support OABI, unlike 32-bit ARM build */
 			scno = arm_regs.ARM_r7;
-			scno = shuffle_scno(scno);
-			update_personality(tcp, 1);
 			break;
 	}
 
diff --git a/linux/aarch64/nr_prefix.c b/linux/aarch64/nr_prefix.c
new file mode 100644
index 0000000..49fe77a
--- /dev/null
+++ b/linux/aarch64/nr_prefix.c
@@ -0,0 +1 @@
+#include "../arm/nr_prefix.c"
diff --git a/linux/aarch64/shuffle_scno.c b/linux/aarch64/shuffle_scno.c
new file mode 100644
index 0000000..7d4de73
--- /dev/null
+++ b/linux/aarch64/shuffle_scno.c
@@ -0,0 +1,12 @@
+#define shuffle_scno arm_shuffle_scno
+#include "../arm/shuffle_scno.c"
+#undef shuffle_scno
+
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+	if (current_personality == 1)
+		return arm_shuffle_scno(scno);
+
+	return scno;
+}
diff --git a/linux/aarch64/syscallent.h b/linux/aarch64/syscallent.h
index 4ff6118..3220420 100644
--- a/linux/aarch64/syscallent.h
+++ b/linux/aarch64/syscallent.h
@@ -49,7 +49,7 @@
 [1057] = { 3,	TD,		SEN(lseek),		"lseek"		},
 [1058] = { 6,	TD|TM|SI,	SEN(mmap),		"mmap"		},
 [1059] = { 1,	0,		SEN(alarm),		"alarm"		},
-[1060] = { 0,	0,		SEN(getpgrp),		"getpgrp"	},
+[1060] = { 0,	PU|NF,		SEN(getpgrp),		"getpgrp"	},
 [1061] = { 0,	TS,		SEN(pause),		"pause"		},
 [1062] = { 1,	0,		SEN(time),		"time"		},
 [1063] = { 2,	TF,		SEN(utime),		"utime"		},
diff --git a/linux/alpha/arch_defs_.h b/linux/alpha/arch_defs_.h
new file mode 100644
index 0000000..f6fe59e
--- /dev/null
+++ b/linux/alpha/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/alpha/arch_getrval2.c b/linux/alpha/arch_getrval2.c
index f78a9f0..7953352 100644
--- a/linux/alpha/arch_getrval2.c
+++ b/linux/alpha/arch_getrval2.c
@@ -2,7 +2,7 @@
 getrval2(struct tcb *tcp)
 {
 	unsigned long r20;
-	if (upeek(tcp->pid, 20, &r20) < 0)
+	if (upeek(tcp, 20, &r20) < 0)
 		return -1;
 	return r20;
 }
diff --git a/linux/alpha/arch_rt_sigframe.c b/linux/alpha/arch_rt_sigframe.c
index 3343183..d341be1 100644
--- a/linux/alpha/arch_rt_sigframe.c
+++ b/linux/alpha/arch_rt_sigframe.c
@@ -29,5 +29,5 @@
 {
 	unsigned long addr;
 
-	return upeek(tcp->pid, REG_FP, &addr) ? 0 : addr;
+	return upeek(tcp, REG_FP, &addr) ? 0 : addr;
 }
diff --git a/linux/alpha/arch_sigreturn.c b/linux/alpha/arch_sigreturn.c
index d5f19c5..396187a 100644
--- a/linux/alpha/arch_sigreturn.c
+++ b/linux/alpha/arch_sigreturn.c
@@ -3,7 +3,7 @@
 {
 	unsigned long addr;
 
-	if (upeek(tcp->pid, REG_FP, &addr) < 0)
+	if (upeek(tcp, REG_FP, &addr) < 0)
 		return;
 	addr += offsetof(struct sigcontext, sc_mask);
 
diff --git a/linux/alpha/get_scno.c b/linux/alpha/get_scno.c
index 3ffd78a..3142da2 100644
--- a/linux/alpha/get_scno.c
+++ b/linux/alpha/get_scno.c
@@ -4,9 +4,9 @@
 {
 	kernel_ulong_t scno = 0;
 
-	if (upeek(tcp->pid, REG_A3, &alpha_a3) < 0)
+	if (upeek(tcp, REG_A3, &alpha_a3) < 0)
 		return -1;
-	if (upeek(tcp->pid, REG_R0, &scno) < 0)
+	if (upeek(tcp, REG_R0, &scno) < 0)
 		return -1;
 
 	/*
diff --git a/linux/alpha/get_syscall_args.c b/linux/alpha/get_syscall_args.c
index a385726..be61abf 100644
--- a/linux/alpha/get_syscall_args.c
+++ b/linux/alpha/get_syscall_args.c
@@ -5,7 +5,7 @@
 	unsigned int i;
 
 	for (i = 0; i < tcp->s_ent->nargs; ++i)
-		if (upeek(tcp->pid, REG_A0+i, &tcp->u_arg[i]) < 0)
+		if (upeek(tcp, REG_A0+i, &tcp->u_arg[i]) < 0)
 			return -1;
 	return 1;
 }
diff --git a/linux/alpha/get_syscall_result.c b/linux/alpha/get_syscall_result.c
index f4c504f..e49a825 100644
--- a/linux/alpha/get_syscall_result.c
+++ b/linux/alpha/get_syscall_result.c
@@ -1,6 +1,6 @@
 static int
 get_syscall_result_regs(struct tcb *tcp)
 {
-	return (upeek(tcp->pid, REG_A3, &alpha_a3) < 0 ||
-		upeek(tcp->pid, REG_R0, &alpha_r0) < 0) ? -1 : 0;
+	return (upeek(tcp, REG_A3, &alpha_a3) < 0 ||
+		upeek(tcp, REG_R0, &alpha_r0) < 0) ? -1 : 0;
 }
diff --git a/linux/alpha/set_error.c b/linux/alpha/set_error.c
index bcc5ff8..169277b 100644
--- a/linux/alpha/set_error.c
+++ b/linux/alpha/set_error.c
@@ -2,12 +2,12 @@
 arch_set_error(struct tcb *tcp)
 {
 	alpha_r0 = tcp->u_error;
-	return upoke(tcp->pid, REG_R0, alpha_r0);
+	return upoke(tcp, REG_R0, alpha_r0);
 }
 
 static int
 arch_set_success(struct tcb *tcp)
 {
-	return upoke(tcp->pid, REG_A3, (alpha_a3 = 0))
-	       || upoke(tcp->pid, REG_R0, (alpha_r0 = tcp->u_rval));
+	return upoke(tcp, REG_A3, (alpha_a3 = 0))
+	       || upoke(tcp, REG_R0, (alpha_r0 = tcp->u_rval));
 }
diff --git a/linux/alpha/set_scno.c b/linux/alpha/set_scno.c
index d5bcfb6..e285c9a 100644
--- a/linux/alpha/set_scno.c
+++ b/linux/alpha/set_scno.c
@@ -1,5 +1,5 @@
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	return upoke(tcp->pid, REG_R0, scno);
+	return upoke(tcp, REG_R0, scno);
 }
diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h
index 5a72bb2..700ae29 100644
--- a/linux/alpha/syscallent.h
+++ b/linux/alpha/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 18] = { 5,	TSFA,		SEN(printargs),			"osf_getfsstat"		}, /* not implemented */
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getxpid),			"getxpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getxpid),			"getxpid"		},
 [ 21] = { 4,	0,		SEN(printargs),			"osf_mount"		},
 [ 22] = { 2,	TF,		SEN(umount2),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getxuid),			"getxuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getxuid),			"getxuid"		},
 [ 25] = { 5,	0,		SEN(printargs),			"exec_with_loader"	}, /* not implemented */
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 5,	0,		SEN(printargs),			"osf_nrecvmsg"		}, /* not implemented */
@@ -74,7 +74,7 @@
 [ 44] = { 5,	0,		SEN(printargs),			"osf_profil"		}, /* not implemented */
 [ 45] = { 3,	TD|TF,		SEN(open),			"open"			},
 [ 46] = { 5,	0,		SEN(printargs),			"osf_old_sigaction"	}, /* not implemented */
-[ 47] = { 0,	NF,		SEN(getxgid),			"getxgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getxgid),			"getxgid"		},
 [ 48] = { 2,	TS,		SEN(osf_sigprocmask),		"osf_sigprocmask"	},
 [ 49] = { 5,	0,		SEN(printargs),			"osf_getlogin"		}, /* not implemented */
 [ 50] = { 5,	0,		SEN(printargs),			"osf_setlogin"		}, /* not implemented */
@@ -90,8 +90,8 @@
 [ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 5,	TD|TFST|TSTA,	SEN(printargs),			"osf_old_fstat"		}, /* not implemented */
-[ 63] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
-[ 64] = { 0,	0,		SEN(getpagesize),		"getpagesize"		},
+[ 63] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getpagesize),		"getpagesize"		},
 [ 65] = { 5,	TM,		SEN(printargs),			"osf_mremap"		}, /* not implemented */
 [ 66] = { 0,	TP,		SEN(vfork),			"vfork"			},
 [ 67] = { 2,	TF|TST|TSTA,	SEN(stat),			"stat"			},
@@ -116,7 +116,7 @@
 [ 86] = { 2,	0,		SEN(osf_getitimer),		"osf_getitimer"		},
 [ 87] = { 2,	0,		SEN(gethostname),		"gethostname"		},
 [ 88] = { 2,	0,		SEN(sethostname),		"sethostname"		},
-[ 89] = { 0,	0,		SEN(getdtablesize),		"getdtablesize"		},
+[ 89] = { 0,	PU|NF,		SEN(getdtablesize),		"getdtablesize"		},
 [ 90] = { 2,	TD,		SEN(dup2),			"dup2"			},
 [ 91] = { 2,	TD|TFST|TSTA,	SEN(fstat),			"fstat"			},
 [ 92] = { 3,	TD,		SEN(fcntl),			"fcntl"			},
@@ -342,7 +342,7 @@
 [375] = { 3,	TM,		SEN(mincore),			"mincore"		},
 [376] = { 3,	0,		SEN(printargs),			"pciconfig_iobase"	},
 [377] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
-[378] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[378] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [379] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [380] = { },
 [381] = { 2,	TS,		SEN(kill),			"tkill"			},
@@ -395,12 +395,12 @@
 [429] = { 6,	TM,		SEN(mbind),			"mbind"			}, /* not implemented */
 [430] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		}, /* not implemented */
 [431] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		}, /* not implemented */
-[432] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[432] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [433] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[434] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[435] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[436] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[437] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[434] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[435] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[436] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[437] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [438] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [439] = { 5,	0,		SEN(add_key),			"add_key"		},
 [440] = { 4,	0,		SEN(request_key),		"request_key"		},
diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
index edcdff2..1b7fd77 100644
--- a/linux/arc/syscallent.h
+++ b/linux/arc/syscallent.h
@@ -3,6 +3,6 @@
 /* [244 ... 259] are arch specific */
 [244] = { 3,	0,	SEN(printargs),	"cacheflush"	},
 [245] = { 1,	0,	SEN(printargs),	"arc_settls"	},
-[246] = { 0,	0,	SEN(printargs),	"arc_gettls"	},
+[246] = { 0,	PU|NF,	SEN(printargs),	"arc_gettls"	},
 [247] = { 3,	0,	SEN(sysfs),	"sysfs"		},
 [248] = { 3,	0,	SEN(printargs),	"arc_usr_cmpxchg"},
diff --git a/linux/arch_defs_.h b/linux/arch_defs_.h
new file mode 100644
index 0000000..a66be26
--- /dev/null
+++ b/linux/arch_defs_.h
@@ -0,0 +1,33 @@
+/* Fallback file for arch-specific definitions.  */
+
+#ifndef HAVE_ARCH_GETRVAL2
+# define HAVE_ARCH_GETRVAL2 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_MMAP
+# define HAVE_ARCH_OLD_MMAP 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_MMAP_PGOFF
+# define HAVE_ARCH_OLD_MMAP_PGOFF 0
+#endif
+
+#ifndef HAVE_ARCH_OLD_SELECT
+# define HAVE_ARCH_OLD_SELECT 0
+#endif
+
+#ifndef HAVE_ARCH_UID16_SYSCALLS
+# define HAVE_ARCH_UID16_SYSCALLS 0
+#endif
+
+#ifndef DEFAULT_PERSONALITY
+# define DEFAULT_PERSONALITY 0
+#endif
+
+#ifndef SUPPORTED_PERSONALITIES
+# define SUPPORTED_PERSONALITIES 1
+#endif
+
+#ifndef HAVE_ARCH_DEDICATED_ERR_REG
+# define HAVE_ARCH_DEDICATED_ERR_REG 0
+#endif
diff --git a/linux/arch_kvm.c b/linux/arch_kvm.c
new file mode 100644
index 0000000..f12f32a
--- /dev/null
+++ b/linux/arch_kvm.c
@@ -0,0 +1,19 @@
+#ifdef HAVE_STRUCT_KVM_REGS
+static void
+arch_print_kvm_regs(struct tcb *const tcp,
+		    const kernel_ulong_t addr,
+		    const struct kvm_regs *const regs)
+{
+	printaddr(addr);
+}
+#endif	/* HAVE_STRUCT_KVM_REGS */
+
+#ifdef HAVE_STRUCT_KVM_SREGS
+static void
+arch_print_kvm_sregs(struct tcb *const tcp,
+		    const kernel_ulong_t addr,
+		    const struct kvm_sregs *const sregs)
+{
+	printaddr(addr);
+}
+#endif	/* HAVE_STRUCT_KVM_SREGS */
diff --git a/linux/arm/arch_defs_.h b/linux/arm/arch_defs_.h
new file mode 100644
index 0000000..a8e961f
--- /dev/null
+++ b/linux/arm/arch_defs_.h
@@ -0,0 +1,3 @@
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c
index 5f68069..2cd5c71 100644
--- a/linux/arm/get_scno.c
+++ b/linux/arm/get_scno.c
@@ -2,7 +2,7 @@
  * Copyright (c) 2003 Russell King <rmk@arm.linux.org.uk>
  * Copyright (c) 2011-2013 Denys Vlasenko <vda.linux@googlemail.com>
  * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
- * Copyright (c) 2015-2017 The strace developers.
+ * Copyright (c) 2015-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -67,18 +67,13 @@
 
 #endif
 
-	scno = shuffle_scno(scno);
-
 	/*
 	 * Do some sanity checks to figure out
 	 * whether it's really a syscall entry.
 	 */
 	if (arm_regs.ARM_ip && !scno_in_range(scno)) {
-		if (debug_flag)
-			error_msg("pid %d stray syscall exit:"
-				  " ARM_ip = %ld, scno = %ld",
-				  tcp->pid, arm_regs.ARM_ip,
-				  shuffle_scno(scno));
+		debug_msg("pid %d stray syscall exit: ARM_ip = %ld, scno = %ld",
+			  tcp->pid, arm_regs.ARM_ip, scno);
 		return 0;
 	}
 
diff --git a/linux/arm/nr_prefix.c b/linux/arm/nr_prefix.c
new file mode 100644
index 0000000..99f571f
--- /dev/null
+++ b/linux/arm/nr_prefix.c
@@ -0,0 +1,12 @@
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+	/*
+	 * For now, the set of syscalls that are shuffled is equivalent to the
+	 * set of syscalls that have __ARM_NR_ prefix.
+	 */
+	if (shuffle_scno(scno) != scno)
+		return "__ARM_NR_";
+	else
+		return "__NR_";
+}
diff --git a/linux/arm/shuffle_scno.c b/linux/arm/shuffle_scno.c
new file mode 100644
index 0000000..17a40d6
--- /dev/null
+++ b/linux/arm/shuffle_scno.c
@@ -0,0 +1,28 @@
+kernel_ulong_t
+shuffle_scno(kernel_ulong_t scno)
+{
+	if (scno < ARM_FIRST_SHUFFLED_SYSCALL)
+		return scno;
+
+	/* __ARM_NR_cmpxchg? Swap with LAST_ORDINARY+1 */
+	if (scno == ARM_FIRST_SHUFFLED_SYSCALL)
+		return 0x000ffff0;
+	if (scno == 0x000ffff0)
+		return ARM_FIRST_SHUFFLED_SYSCALL;
+
+#define ARM_SECOND_SHUFFLED_SYSCALL (ARM_FIRST_SHUFFLED_SYSCALL + 1)
+	/*
+	 * Is it ARM specific syscall?
+	 * Swap [0x000f0000, 0x000f0000 + LAST_SPECIAL] range
+	 * with [SECOND_SHUFFLED, SECOND_SHUFFLED + LAST_SPECIAL] range.
+	 */
+	if (scno >= 0x000f0000 &&
+	    scno <= 0x000f0000 + ARM_LAST_SPECIAL_SYSCALL) {
+		return scno - 0x000f0000 + ARM_SECOND_SHUFFLED_SYSCALL;
+	}
+	if (scno <= ARM_SECOND_SHUFFLED_SYSCALL + ARM_LAST_SPECIAL_SYSCALL) {
+		return scno + 0x000f0000 - ARM_SECOND_SHUFFLED_SYSCALL;
+	}
+
+	return scno;
+}
diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h
index c5b9564..76edf99 100644
--- a/linux/arm/syscallent.h
+++ b/linux/arm/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -226,10 +226,10 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(geteuid),			"getegid32"		},
+[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF,		SEN(geteuid),			"getegid32"		},
 [203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
 [204] = { 2,	0,		SEN(setregid),			"setregid32"		},
 [205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
@@ -250,7 +250,7 @@
 [220] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[224] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [225] = { 5,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -299,12 +299,12 @@
 [271] = { 3,	0,		SEN(printargs),			"pciconfig_iobase"	},
 [272] = { 5,	0,		SEN(printargs),			"pciconfig_read"	},
 [273] = { 5,	0,		SEN(printargs),			"pciconfig_write"	},
-[274] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[274] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [275] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[276] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[277] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[278] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[279] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[276] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[277] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[278] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[279] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [280] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [281] = { 3,	TN,		SEN(socket),			"socket"		},
 [282] = { 3,	TN,		SEN(bind),			"bind"			},
@@ -444,9 +444,10 @@
  * Remapped by shuffle_scno() to be directly after __ARM_NR_cmpxchg.
  */
 [ARM_FIRST_SHUFFLED_SYSCALL+1+0] = { },
-[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 5,	0,	SEN(printargs),	"breakpoint"		},
-[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 5,	0,	SEN(printargs),	"cacheflush"		},
-[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 5,	0,	SEN(printargs),	"usr26"			},
-[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 5,	0,	SEN(printargs),	"usr32"			},
-[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 5,	0,	SEN(printargs),	"set_tls"		},
-#define ARM_LAST_SPECIAL_SYSCALL 5
+[ARM_FIRST_SHUFFLED_SYSCALL+1+1] = { 0,	0,	SEN(printargs),	"breakpoint"		},
+[ARM_FIRST_SHUFFLED_SYSCALL+1+2] = { 3,	TM,	SEN(printargs),	"cacheflush"		},
+[ARM_FIRST_SHUFFLED_SYSCALL+1+3] = { 0,	0,	SEN(printargs),	"usr26"			},
+[ARM_FIRST_SHUFFLED_SYSCALL+1+4] = { 0,	0,	SEN(printargs),	"usr32"			},
+[ARM_FIRST_SHUFFLED_SYSCALL+1+5] = { 1,	0,	SEN(printargs),	"set_tls"		},
+[ARM_FIRST_SHUFFLED_SYSCALL+1+6] = { 0,	PU|NF,	SEN(printargs),	"get_tls"		},
+#define ARM_LAST_SPECIAL_SYSCALL 6
diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h
index d75e5df..c9dc52c 100644
--- a/linux/avr32/syscallent.h
+++ b/linux/avr32/syscallent.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2004-2009 Atmel Corporation
- * Copyright (c) 2009-2017 The strace developers.
+ * Copyright (c) 2009-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -46,11 +46,11 @@
 [ 17] = { 3,	TF,		SEN(chown),			"lchown"		},
 [ 18] = { 3,	TD,		SEN(lseek),			"lseek"			},
 [ 19] = { 5,	TD,		SEN(llseek),			"_llseek"		},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount2),			"umount2"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -73,10 +73,10 @@
 [ 44] = { 5,	TP,		SEN(clone),			"clone"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
 [ 48] = { 2,	TF,		SEN(getcwd),			"getcwd"		},
-[ 49] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [ 53] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -90,8 +90,8 @@
 [ 61] = { 2,	0,		SEN(setregid),			"setregid"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 4,	TS,		SEN(rt_sigaction),		"rt_sigaction"		},
 [ 68] = { 0,	TS,		SEN(rt_sigreturn),		"rt_sigreturn"		},
@@ -202,7 +202,7 @@
 [173] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [174] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [175] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
-[176] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[176] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [177] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [178] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [179] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -253,12 +253,12 @@
 [224] = { 6,	TD,		SEN(fadvise64_64),		"fadvise64_64"		},
 [225] = { 3,	0,		SEN(printargs),			"cacheflush"		},
 [226] = { 5,	0,		SEN(vserver),			"vserver"		},
-[227] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[227] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [228] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[229] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[230] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[231] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[232] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[229] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[230] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[231] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[232] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [233] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [234] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [235] = { 5,	0,		SEN(add_key),			"add_key"		},
diff --git a/linux/bfin/arch_defs_.h b/linux/bfin/arch_defs_.h
new file mode 100644
index 0000000..d642058
--- /dev/null
+++ b/linux/bfin/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/linux/bfin/arch_rt_sigframe.c b/linux/bfin/arch_rt_sigframe.c
index d84b834..1692685 100644
--- a/linux/bfin/arch_rt_sigframe.c
+++ b/linux/bfin/arch_rt_sigframe.c
@@ -29,5 +29,5 @@
 {
 	unsigned long addr;
 
-	return upeek(tcp->pid, PT_USP, &addr) ? 0 : addr;
+	return upeek(tcp, PT_USP, &addr) ? 0 : addr;
 }
diff --git a/linux/bfin/get_scno.c b/linux/bfin/get_scno.c
index 8c3a7d2..c394889 100644
--- a/linux/bfin/get_scno.c
+++ b/linux/bfin/get_scno.c
@@ -2,5 +2,5 @@
 static int
 arch_get_scno(struct tcb *tcp)
 {
-	return upeek(tcp->pid, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1;
+	return upeek(tcp, PT_ORIG_P0, &tcp->scno) < 0 ? -1 : 1;
 }
diff --git a/linux/bfin/get_syscall_args.c b/linux/bfin/get_syscall_args.c
index 69613d4..506d3a9 100644
--- a/linux/bfin/get_syscall_args.c
+++ b/linux/bfin/get_syscall_args.c
@@ -8,7 +8,7 @@
 	unsigned int i;
 
 	for (i = 0; i < tcp->s_ent->nargs; ++i)
-		if (upeek(tcp->pid, argreg[i], &tcp->u_arg[i]) < 0)
+		if (upeek(tcp, argreg[i], &tcp->u_arg[i]) < 0)
 			return -1;
 	return 1;
 }
diff --git a/linux/bfin/get_syscall_result.c b/linux/bfin/get_syscall_result.c
index c189a5f..5c814b4 100644
--- a/linux/bfin/get_syscall_result.c
+++ b/linux/bfin/get_syscall_result.c
@@ -1,5 +1,5 @@
 static int
 get_syscall_result_regs(struct tcb *tcp)
 {
-	return upeek(tcp->pid, PT_R0, &bfin_r0) < 0 ? -1 : 0;
+	return upeek(tcp, PT_R0, &bfin_r0) < 0 ? -1 : 0;
 }
diff --git a/linux/bfin/set_error.c b/linux/bfin/set_error.c
index 2bfecda..002d904 100644
--- a/linux/bfin/set_error.c
+++ b/linux/bfin/set_error.c
@@ -2,12 +2,12 @@
 arch_set_error(struct tcb *tcp)
 {
 	bfin_r0 = -tcp->u_error;
-	return upoke(tcp->pid, PT_R0, bfin_r0);
+	return upoke(tcp, PT_R0, bfin_r0);
 }
 
 static int
 arch_set_success(struct tcb *tcp)
 {
 	bfin_r0 = tcp->u_rval;
-	return upoke(tcp->pid, PT_R0, bfin_r0);
+	return upoke(tcp, PT_R0, bfin_r0);
 }
diff --git a/linux/bfin/set_scno.c b/linux/bfin/set_scno.c
index 4508be1..d63230f 100644
--- a/linux/bfin/set_scno.c
+++ b/linux/bfin/set_scno.c
@@ -1,5 +1,5 @@
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	return upoke(tcp->pid, PT_ORIG_P0, scno);
+	return upoke(tcp, PT_ORIG_P0, scno);
 }
diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h
index b68443e..1ce2ff3 100644
--- a/linux/bfin/syscallent.h
+++ b/linux/bfin/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -226,10 +226,10 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"chown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(geteuid),			"getegid32"		},
+[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF,		SEN(geteuid),			"getegid32"		},
 [203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
 [204] = { 2,	0,		SEN(setregid),			"setregid32"		},
 [205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
@@ -250,7 +250,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[224] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -304,12 +304,12 @@
 [275] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [276] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [277] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[278] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[278] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [279] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[280] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[281] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[282] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[283] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[280] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[281] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[282] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[283] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [284] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [285] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [286] = { 5,	0,		SEN(add_key),			"add_key"		},
diff --git a/linux/crisv10/arch_regs.c b/linux/crisv10/arch_regs.c
deleted file mode 100644
index 9c372a3..0000000
--- a/linux/crisv10/arch_regs.c
+++ /dev/null
@@ -1,2 +0,0 @@
-static unsigned long cris_r10;
-#define ARCH_PC_PEEK_ADDR (4 * PT_IRP)
diff --git a/linux/crisv10/arch_sigreturn.c b/linux/crisv10/arch_sigreturn.c
deleted file mode 100644
index 0458c8e..0000000
--- a/linux/crisv10/arch_sigreturn.c
+++ /dev/null
@@ -1,16 +0,0 @@
-static void
-arch_sigreturn(struct tcb *tcp)
-{
-	unsigned long regs[PT_MAX + 1];
-
-	if (ptrace(PTRACE_GETREGS, tcp->pid, NULL, regs) < 0) {
-		perror_msg("sigreturn: PTRACE_GETREGS");
-		return;
-	}
-	const unsigned long addr =
-		regs[PT_USP] + offsetof(struct sigcontext, oldmask);
-
-	tprints("{mask=");
-	print_sigset_addr(tcp, addr);
-	tprints("}");
-}
diff --git a/linux/crisv10/get_error.c b/linux/crisv10/get_error.c
deleted file mode 100644
index 2c81f1b..0000000
--- a/linux/crisv10/get_error.c
+++ /dev/null
@@ -1,12 +0,0 @@
-#include "negated_errno.h"
-
-static void
-get_error(struct tcb *tcp, const bool check_errno)
-{
-	if (check_errno && is_negated_errno(cris_r10)) {
-		tcp->u_rval = -1;
-		tcp->u_error = -cris_r10;
-	} else {
-		tcp->u_rval = cris_r10;
-	}
-}
diff --git a/linux/crisv10/get_scno.c b/linux/crisv10/get_scno.c
deleted file mode 100644
index 14ff338..0000000
--- a/linux/crisv10/get_scno.c
+++ /dev/null
@@ -1,6 +0,0 @@
-/* Return codes: 1 - ok, 0 - ignore, other - error. */
-static int
-arch_get_scno(struct tcb *tcp)
-{
-	return upeek(tcp->pid, 4 * PT_R9, &tcp->scno) < 0 ? -1 : 1;
-}
diff --git a/linux/crisv10/get_syscall_args.c b/linux/crisv10/get_syscall_args.c
deleted file mode 100644
index bdd0574..0000000
--- a/linux/crisv10/get_syscall_args.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/* Return -1 on error or 1 on success (never 0!). */
-static int
-get_syscall_args(struct tcb *tcp)
-{
-	static const int crisregs[MAX_ARGS] = {
-		4*PT_ORIG_R10, 4*PT_R11, 4*PT_R12,
-		4*PT_R13     , 4*PT_MOF, 4*PT_SRP
-	};
-	unsigned int i;
-
-	for (i = 0; i < tcp->s_ent->nargs; ++i)
-		if (upeek(tcp->pid, crisregs[i], &tcp->u_arg[i]) < 0)
-			return -1;
-	return 1;
-}
diff --git a/linux/crisv10/get_syscall_result.c b/linux/crisv10/get_syscall_result.c
deleted file mode 100644
index 6b3679c..0000000
--- a/linux/crisv10/get_syscall_result.c
+++ /dev/null
@@ -1,5 +0,0 @@
-static int
-get_syscall_result_regs(struct tcb *tcp)
-{
-	return upeek(tcp->pid, 4 * PT_R10, &cris_r10) < 0 ? -1 : 0;
-}
diff --git a/linux/crisv10/rt_sigframe.h b/linux/crisv10/rt_sigframe.h
deleted file mode 100644
index 6080bae..0000000
--- a/linux/crisv10/rt_sigframe.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright (c) 2017 Dmitry V. Levin <ldv@altlinux.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. The name of the author may not be used to endorse or promote products
- *    derived from this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
- * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
- * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
- * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef STRACE_RT_SIGFRAME_H
-#define STRACE_RT_SIGFRAME_H
-
-#include <signal.h>
-
-typedef struct {
-	siginfo_t	*pinfo;
-	void		*puc;
-	siginfo_t	info;
-	ucontext_t	uc;
-	/* more data follows */
-} struct_rt_sigframe;
-
-#endif /* !STRACE_RT_SIGFRAME_H */
diff --git a/linux/crisv10/set_error.c b/linux/crisv10/set_error.c
deleted file mode 100644
index 3a14a87..0000000
--- a/linux/crisv10/set_error.c
+++ /dev/null
@@ -1,13 +0,0 @@
-static int
-arch_set_error(struct tcb *tcp)
-{
-	cris_r10 = -tcp->u_error;
-	return upoke(tcp->pid, 4 * PT_R10, cris_r10);
-}
-
-static int
-arch_set_success(struct tcb *tcp)
-{
-	cris_r10 = tcp->u_rval;
-	return upoke(tcp->pid, 4 * PT_R10, cris_r10);
-}
diff --git a/linux/crisv10/set_scno.c b/linux/crisv10/set_scno.c
deleted file mode 100644
index 0de38fa..0000000
--- a/linux/crisv10/set_scno.c
+++ /dev/null
@@ -1,5 +0,0 @@
-static int
-arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
-{
-	return upoke(tcp->pid, 4 * PT_R9, scno);
-}
diff --git a/linux/crisv10/syscallent.h b/linux/crisv10/syscallent.h
deleted file mode 100644
index 0232d2f..0000000
--- a/linux/crisv10/syscallent.h
+++ /dev/null
@@ -1,358 +0,0 @@
-[  0] = { 0,	0,		SEN(restart_syscall),		"restart_syscall"	},
-[  1] = { 1,	TP|SE,		SEN(exit),			"exit"			},
-[  2] = { 0,	TP,		SEN(fork),			"fork"			},
-[  3] = { 3,	TD,		SEN(read),			"read"			},
-[  4] = { 3,	TD,		SEN(write),			"write"			},
-[  5] = { 3,	TD|TF,		SEN(open),			"open"			},
-[  6] = { 1,	TD,		SEN(close),			"close"			},
-[  7] = { 3,	TP,		SEN(waitpid),			"waitpid"		},
-[  8] = { 2,	TD|TF,		SEN(creat),			"creat"			},
-[  9] = { 2,	TF,		SEN(link),			"link"			},
-[ 10] = { 1,	TF,		SEN(unlink),			"unlink"		},
-[ 11] = { 3,	TF|TP|SE|SI,	SEN(execve),			"execve"		},
-[ 12] = { 1,	TF,		SEN(chdir),			"chdir"			},
-[ 13] = { 1,	0,		SEN(time),			"time"			},
-[ 14] = { 3,	TF,		SEN(mknod),			"mknod"			},
-[ 15] = { 2,	TF,		SEN(chmod),			"chmod"			},
-[ 16] = { 3,	TF,		SEN(chown16),			"lchown"		},
-[ 17] = { 0,	TM,		SEN(break),			"break"			},
-[ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
-[ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
-[ 21] = { 5,	TF,		SEN(mount),			"mount"			},
-[ 22] = { 1,	TF,		SEN(umount),			"umount"		},
-[ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
-[ 25] = { 1,	0,		SEN(stime),			"stime"			},
-[ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
-[ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
-[ 28] = { 2,	TD|TFST|TSTA,	SEN(oldfstat),			"oldfstat"		},
-[ 29] = { 0,	TS,		SEN(pause),			"pause"			},
-[ 30] = { 2,	TF,		SEN(utime),			"utime"			},
-[ 31] = { 2,	0,		SEN(stty),			"stty"			},
-[ 32] = { 2,	0,		SEN(gtty),			"gtty"			},
-[ 33] = { 2,	TF,		SEN(access),			"access"		},
-[ 34] = { 1,	0,		SEN(nice),			"nice"			},
-[ 35] = { 0,	0,		SEN(ftime),			"ftime"			},
-[ 36] = { 0,	0,		SEN(sync),			"sync"			},
-[ 37] = { 2,	TS,		SEN(kill),			"kill"			},
-[ 38] = { 2,	TF,		SEN(rename),			"rename"		},
-[ 39] = { 2,	TF,		SEN(mkdir),			"mkdir"			},
-[ 40] = { 1,	TF,		SEN(rmdir),			"rmdir"			},
-[ 41] = { 1,	TD,		SEN(dup),			"dup"			},
-[ 42] = { 1,	TD,		SEN(pipe),			"pipe"			},
-[ 43] = { 1,	0,		SEN(times),			"times"			},
-[ 44] = { 0,	0,		SEN(prof),			"prof"			},
-[ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
-[ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
-[ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
-[ 51] = { 1,	TF,		SEN(acct),			"acct"			},
-[ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
-[ 53] = { 0,	0,		SEN(lock),			"lock"			},
-[ 54] = { 3,	TD,		SEN(ioctl),			"ioctl"			},
-[ 55] = { 3,	TD,		SEN(fcntl),			"fcntl"			},
-[ 56] = { 0,	0,		SEN(mpx),			"mpx"			},
-[ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
-[ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
-[ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
-[ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
-[ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
-[ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
-[ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
-[ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
-[ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
-[ 69] = { 1,	TS,		SEN(ssetmask),			"ssetmask"		},
-[ 70] = { 2,	0,		SEN(setreuid16),		"setreuid"		},
-[ 71] = { 2,	0,		SEN(setregid16),		"setregid"		},
-[ 72] = { 1,	TS,		SEN(sigsuspend),		"sigsuspend"		},
-[ 73] = { 1,	TS,		SEN(sigpending),		"sigpending"		},
-[ 74] = { 2,	0,		SEN(sethostname),		"sethostname"		},
-[ 75] = { 2,	0,		SEN(setrlimit),			"setrlimit"		},
-[ 76] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
-[ 77] = { 2,	0,		SEN(getrusage),			"getrusage"		},
-[ 78] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
-[ 79] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
-[ 80] = { 2,	0,		SEN(getgroups16),		"getgroups"		},
-[ 81] = { 2,	0,		SEN(setgroups16),		"setgroups"		},
-[ 82] = { 1,	TD,		SEN(oldselect),			"select"		},
-[ 83] = { 2,	TF,		SEN(symlink),			"symlink"		},
-[ 84] = { 2,	TF|TLST|TSTA,	SEN(oldlstat),			"oldlstat"		},
-[ 85] = { 3,	TF,		SEN(readlink),			"readlink"		},
-[ 86] = { 1,	TF,		SEN(uselib),			"uselib"		},
-[ 87] = { 2,	TF,		SEN(swapon),			"swapon"		},
-[ 88] = { 4,	0,		SEN(reboot),			"reboot"		},
-[ 89] = { 3,	TD,		SEN(readdir),			"readdir"		},
-[ 90] = { 1,	TD|TM|SI,	SEN(old_mmap),			"mmap"			},
-[ 91] = { 2,	TM|SI,		SEN(munmap),			"munmap"		},
-[ 92] = { 2,	TF,		SEN(truncate),			"truncate"		},
-[ 93] = { 2,	TD,		SEN(ftruncate),			"ftruncate"		},
-[ 94] = { 2,	TD,		SEN(fchmod),			"fchmod"		},
-[ 95] = { 3,	TD,		SEN(fchown16),			"fchown"		},
-[ 96] = { 2,	0,		SEN(getpriority),		"getpriority"		},
-[ 97] = { 3,	0,		SEN(setpriority),		"setpriority"		},
-[ 98] = { 4,	0,		SEN(profil),			"profil"		},
-[ 99] = { 2,	TF|TSF|TSFA,	SEN(statfs),			"statfs"		},
-[100] = { 2,	TD|TFSF|TSFA,	SEN(fstatfs),			"fstatfs"		},
-[101] = { 3,	0,		SEN(ioperm),			"ioperm"		},
-[102] = { 2,	TD,		SEN(socketcall),		"socketcall"		},
-[103] = { 3,	0,		SEN(syslog),			"syslog"		},
-[104] = { 3,	0,		SEN(setitimer),			"setitimer"		},
-[105] = { 2,	0,		SEN(getitimer),			"getitimer"		},
-[106] = { 2,	TF|TST|TSTA,	SEN(stat),			"stat"			},
-[107] = { 2,	TF|TLST|TSTA,	SEN(lstat),			"lstat"			},
-[108] = { 2,	TD|TFST|TSTA,	SEN(fstat),			"fstat"			},
-[109] = { 1,	0,		SEN(olduname),			"olduname"		},
-[110] = { 1,	0,		SEN(iopl),			"iopl"			},
-[111] = { 0,	0,		SEN(vhangup),			"vhangup"		},
-[112] = { 0,	0,		SEN(idle),			"idle"			},
-[113] = { 5,	0,		SEN(vm86),			"vm86"			},
-[114] = { 4,	TP,		SEN(wait4),			"wait4"			},
-[115] = { 1,	TF,		SEN(swapoff),			"swapoff"		},
-[116] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
-[117] = { 6,	TI,		SEN(ipc),			"ipc"			},
-[118] = { 1,	TD,		SEN(fsync),			"fsync"			},
-[119] = { 0,	TS,		SEN(sigreturn),			"sigreturn"		},
-[120] = { 5,	TP,		SEN(clone),			"clone"			},
-[121] = { 2,	0,		SEN(setdomainname),		"setdomainname"		},
-[122] = { 1,	0,		SEN(uname),			"uname"			},
-[123] = { 3,	0,		SEN(modify_ldt),		"modify_ldt"		},
-[124] = { 1,	0,		SEN(adjtimex),			"adjtimex"		},
-[125] = { 3,	TM|SI,		SEN(mprotect),			"mprotect"		},
-[126] = { 3,	TS,		SEN(sigprocmask),		"sigprocmask"		},
-[127] = { 2,	0,		SEN(create_module),		"create_module"		},
-[128] = { 3,	0,		SEN(init_module),		"init_module"		},
-[129] = { 2,	0,		SEN(delete_module),		"delete_module"		},
-[130] = { 1,	0,		SEN(get_kernel_syms),		"get_kernel_syms"	},
-[131] = { 4,	TF,		SEN(quotactl),			"quotactl"		},
-[132] = { 1,	0,		SEN(getpgid),			"getpgid"		},
-[133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
-[134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
-[135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	NF,		SEN(personality),		"personality"		},
-[137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
-[138] = { 1,	NF,		SEN(setfsuid16),		"setfsuid"		},
-[139] = { 1,	NF,		SEN(setfsgid16),		"setfsgid"		},
-[140] = { 5,	TD,		SEN(llseek),			"_llseek"		},
-[141] = { 3,	TD,		SEN(getdents),			"getdents"		},
-[142] = { 5,	TD,		SEN(select),			"_newselect"		},
-[143] = { 2,	TD,		SEN(flock),			"flock"			},
-[144] = { 3,	TM,		SEN(msync),			"msync"			},
-[145] = { 3,	TD,		SEN(readv),			"readv"			},
-[146] = { 3,	TD,		SEN(writev),			"writev"		},
-[147] = { 1,	0,		SEN(getsid),			"getsid"		},
-[148] = { 1,	TD,		SEN(fdatasync),			"fdatasync"		},
-[149] = { 1,	0,		SEN(sysctl),			"_sysctl"		},
-[150] = { 2,	TM,		SEN(mlock),			"mlock"			},
-[151] = { 2,	TM,		SEN(munlock),			"munlock"		},
-[152] = { 1,	TM,		SEN(mlockall),			"mlockall"		},
-[153] = { 0,	TM,		SEN(munlockall),		"munlockall"		},
-[154] = { 2,	0,		SEN(sched_setparam),		"sched_setparam"	},
-[155] = { 2,	0,		SEN(sched_getparam),		"sched_getparam"	},
-[156] = { 3,	0,		SEN(sched_setscheduler),	"sched_setscheduler"	},
-[157] = { 1,	0,		SEN(sched_getscheduler),	"sched_getscheduler"	},
-[158] = { 0,	0,		SEN(sched_yield),		"sched_yield"		},
-[159] = { 1,	0,		SEN(sched_get_priority_max),	"sched_get_priority_max"},
-[160] = { 1,	0,		SEN(sched_get_priority_min),	"sched_get_priority_min"},
-[161] = { 2,	0,		SEN(sched_rr_get_interval),	"sched_rr_get_interval"	},
-[162] = { 2,	0,		SEN(nanosleep),			"nanosleep"		},
-[163] = { 5,	TM|SI,		SEN(mremap),			"mremap"		},
-[164] = { 3,	0,		SEN(setresuid16),		"setresuid"		},
-[165] = { 3,	0,		SEN(getresuid16),		"getresuid"		},
-[167] = { 5,	0,		SEN(query_module),		"query_module"		},
-[168] = { 3,	TD,		SEN(poll),			"poll"			},
-[169] = { 3,	0,		SEN(nfsservctl),		"nfsservctl"		},
-[170] = { 3,	0,		SEN(setresgid16),		"setresgid"		},
-[171] = { 3,	0,		SEN(getresgid16),		"getresgid"		},
-[172] = { 5,	0,		SEN(prctl),			"prctl"			},
-[173] = { 0,	TS,		SEN(rt_sigreturn),		"rt_sigreturn"		},
-[174] = { 4,	TS,		SEN(rt_sigaction),		"rt_sigaction"		},
-[175] = { 4,	TS,		SEN(rt_sigprocmask),		"rt_sigprocmask"	},
-[176] = { 2,	TS,		SEN(rt_sigpending),		"rt_sigpending"		},
-[177] = { 4,	TS,		SEN(rt_sigtimedwait),		"rt_sigtimedwait"	},
-[178] = { 3,	TS,		SEN(rt_sigqueueinfo),		"rt_sigqueueinfo"	},
-[179] = { 2,	TS,		SEN(rt_sigsuspend),		"rt_sigsuspend"		},
-[180] = { 5,	TD,		SEN(pread),			"pread64"		},
-[181] = { 5,	TD,		SEN(pwrite),			"pwrite64"		},
-[182] = { 3,	TF,		SEN(chown16),			"chown"			},
-[183] = { 2,	TF,		SEN(getcwd),			"getcwd"		},
-[184] = { 2,	0,		SEN(capget),			"capget"		},
-[185] = { 2,	0,		SEN(capset),			"capset"		},
-[186] = { 2,	TS,		SEN(sigaltstack),		"sigaltstack"		},
-[187] = { 4,	TD|TN,		SEN(sendfile),			"sendfile"		},
-[188] = { 5,	TN,		SEN(getpmsg),			"getpmsg"		},
-[189] = { 5,	TN,		SEN(putpmsg),			"putpmsg"		},
-[190] = { 0,	TP,		SEN(vfork),			"vfork"			},
-[191] = { 2,	0,		SEN(getrlimit),			"ugetrlimit"		},
-[192] = { 6,	TD|TM|SI,	SEN(mmap_pgoff),		"mmap2"			},
-[193] = { 3,	TF,		SEN(truncate64),		"truncate64"		},
-[194] = { 3,	TD,		SEN(ftruncate64),		"ftruncate64"		},
-[195] = { 2,	TF|TST|TSTA,	SEN(stat64),			"stat64"		},
-[196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
-[197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
-[198] = { 3,	TF,		SEN(chown),			"lchown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(getegid),			"getegid32"		},
-[203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
-[204] = { 2,	0,		SEN(setregid),			"setregid32"		},
-[205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
-[206] = { 2,	0,		SEN(setgroups),			"setgroups32"		},
-[207] = { 3,	TD,		SEN(fchown),			"fchown32"		},
-[208] = { 3,	0,		SEN(setresuid),			"setresuid32"		},
-[209] = { 3,	0,		SEN(getresuid),			"getresuid32"		},
-[210] = { 3,	0,		SEN(setresgid),			"setresgid32"		},
-[211] = { 3,	0,		SEN(getresgid),			"getresgid32"		},
-[212] = { 3,	TF,		SEN(chown),			"chown32"		},
-[213] = { 1,	0,		SEN(setuid),			"setuid32"		},
-[214] = { 1,	0,		SEN(setgid),			"setgid32"		},
-[215] = { 1,	NF,		SEN(setfsuid),			"setfsuid32"		},
-[216] = { 1,	NF,		SEN(setfsgid),			"setfsgid32"		},
-[217] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
-[218] = { 3,	TM,		SEN(mincore),			"mincore"		},
-[219] = { 3,	TM,		SEN(madvise),			"madvise"		},
-[220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
-[221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
-[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
-[225] = { 4,	TD,		SEN(readahead),			"readahead"		},
-[226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
-[227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
-[228] = { 5,	TD,		SEN(fsetxattr),			"fsetxattr"		},
-[229] = { 4,	TF,		SEN(getxattr),			"getxattr"		},
-[230] = { 4,	TF,		SEN(getxattr),			"lgetxattr"		},
-[231] = { 4,	TD,		SEN(fgetxattr),			"fgetxattr"		},
-[232] = { 3,	TF,		SEN(listxattr),			"listxattr"		},
-[233] = { 3,	TF,		SEN(listxattr),			"llistxattr"		},
-[234] = { 3,	TD,		SEN(flistxattr),		"flistxattr"		},
-[235] = { 2,	TF,		SEN(removexattr),		"removexattr"		},
-[236] = { 2,	TF,		SEN(removexattr),		"lremovexattr"		},
-[237] = { 2,	TD,		SEN(fremovexattr),		"fremovexattr"		},
-[238] = { 2,	TS,		SEN(kill),			"tkill"			},
-[239] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile64"		},
-[240] = { 6,	0,		SEN(futex),			"futex"			},
-[241] = { 3,	0,		SEN(sched_setaffinity),		"sched_setaffinity"	},
-[242] = { 3,	0,		SEN(sched_getaffinity),		"sched_getaffinity"	},
-[243] = { 1,	0,		SEN(set_thread_area),		"set_thread_area"	},
-[244] = { 1,	0,		SEN(get_thread_area),		"get_thread_area"	},
-[245] = { 2,	TM,		SEN(io_setup),			"io_setup"		},
-[246] = { 1,	TM,		SEN(io_destroy),		"io_destroy"		},
-[247] = { 5,	0,		SEN(io_getevents),		"io_getevents"		},
-[248] = { 3,	0,		SEN(io_submit),			"io_submit"		},
-[249] = { 3,	0,		SEN(io_cancel),			"io_cancel"		},
-[250] = { 5,	TD,		SEN(fadvise64),			"fadvise64"		},
-[252] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
-[253] = { 4,	0,		SEN(lookup_dcookie),		"lookup_dcookie"	},
-[254] = { 1,	TD,		SEN(epoll_create),		"epoll_create"		},
-[255] = { 4,	TD,		SEN(epoll_ctl),			"epoll_ctl"		},
-[256] = { 4,	TD,		SEN(epoll_wait),		"epoll_wait"		},
-[257] = { 5,	TM|SI,		SEN(remap_file_pages),		"remap_file_pages"	},
-[258] = { 1,	0,		SEN(set_tid_address),		"set_tid_address"	},
-[259] = { 3,	0,		SEN(timer_create),		"timer_create"		},
-[260] = { 4,	0,		SEN(timer_settime),		"timer_settime"		},
-[261] = { 2,	0,		SEN(timer_gettime),		"timer_gettime"		},
-[262] = { 1,	0,		SEN(timer_getoverrun),		"timer_getoverrun"	},
-[263] = { 1,	0,		SEN(timer_delete),		"timer_delete"		},
-[264] = { 2,	0,		SEN(clock_settime),		"clock_settime"		},
-[265] = { 2,	0,		SEN(clock_gettime),		"clock_gettime"		},
-[266] = { 2,	0,		SEN(clock_getres),		"clock_getres"		},
-[267] = { 4,	0,		SEN(clock_nanosleep),		"clock_nanosleep"	},
-[268] = { 3,	TF|TSF|TSFA,	SEN(statfs64),			"statfs64"		},
-[269] = { 3,	TD|TFSF|TSFA,	SEN(fstatfs64),			"fstatfs64"		},
-[270] = { 3,	TS,		SEN(tgkill),			"tgkill"		},
-[271] = { 2,	TF,		SEN(utimes),			"utimes"		},
-[272] = { 6,	TD,		SEN(fadvise64_64),		"fadvise64_64"		},
-[273] = { 5,	0,		SEN(vserver),			"vserver"		},
-[274] = { 6,	TM,		SEN(mbind),			"mbind"			},
-[275] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
-[276] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[277] = { 4,	0,		SEN(mq_open),			"mq_open"		},
-[278] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[279] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[280] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[281] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[282] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
-[283] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
-[284] = { 5,	TP,		SEN(waitid),			"waitid"		},
-[286] = { 5,	0,		SEN(add_key),			"add_key"		},
-[287] = { 4,	0,		SEN(request_key),		"request_key"		},
-[288] = { 5,	0,		SEN(keyctl),			"keyctl"		},
-[289] = { 3,	0,		SEN(ioprio_set),		"ioprio_set"		},
-[290] = { 2,	0,		SEN(ioprio_get),		"ioprio_get"		},
-[291] = { 0,	TD,		SEN(inotify_init),		"inotify_init"		},
-[292] = { 3,	TD|TF,		SEN(inotify_add_watch),		"inotify_add_watch"	},
-[293] = { 2,	TD,		SEN(inotify_rm_watch),		"inotify_rm_watch"	},
-[294] = { 4,	TM,		SEN(migrate_pages),		"migrate_pages"		},
-[295] = { 4,	TD|TF,		SEN(openat),			"openat"		},
-[296] = { 3,	TD|TF,		SEN(mkdirat),			"mkdirat"		},
-[297] = { 4,	TD|TF,		SEN(mknodat),			"mknodat"		},
-[298] = { 5,	TD|TF,		SEN(fchownat),			"fchownat"		},
-[299] = { 3,	TD|TF,		SEN(futimesat),			"futimesat"		},
-[300] = { 4,	TD|TF|TFST|TSTA,SEN(fstatat64),			"fstatat64"		},
-[301] = { 3,	TD|TF,		SEN(unlinkat),			"unlinkat"		},
-[302] = { 4,	TD|TF,		SEN(renameat),			"renameat"		},
-[303] = { 5,	TD|TF,		SEN(linkat),			"linkat"		},
-[304] = { 3,	TD|TF,		SEN(symlinkat),			"symlinkat"		},
-[305] = { 4,	TD|TF,		SEN(readlinkat),		"readlinkat"		},
-[306] = { 3,	TD|TF,		SEN(fchmodat),			"fchmodat"		},
-[307] = { 3,	TD|TF,		SEN(faccessat),			"faccessat"		},
-[308] = { 6,	TD,		SEN(pselect6),			"pselect6"		},
-[309] = { 5,	TD,		SEN(ppoll),			"ppoll"			},
-[310] = { 1,	TP,		SEN(unshare),			"unshare"		},
-[311] = { 2,	0,		SEN(set_robust_list),		"set_robust_list"	},
-[312] = { 3,	0,		SEN(get_robust_list),		"get_robust_list"	},
-[313] = { 6,	TD,		SEN(splice),			"splice"		},
-[314] = { 6,	TD,		SEN(sync_file_range),		"sync_file_range"	},
-[315] = { 4,	TD,		SEN(tee),			"tee"			},
-[316] = { 4,	TD,		SEN(vmsplice),			"vmsplice"		},
-[317] = { 6,	TM,		SEN(move_pages),		"move_pages"		},
-[318] = { 3,	0,		SEN(getcpu),			"getcpu"		},
-[319] = { 6,	TD,		SEN(epoll_pwait),		"epoll_pwait"		},
-[320] = { 4,	TD|TF,		SEN(utimensat),			"utimensat"		},
-[321] = { 3,	TD|TS,		SEN(signalfd),			"signalfd"		},
-[322] = { 2,	TD,		SEN(timerfd_create),		"timerfd_create"	},
-[323] = { 1,	TD,		SEN(eventfd),			"eventfd"		},
-[324] = { 6,	TD,		SEN(fallocate),			"fallocate"		},
-[325] = { 4,	TD,		SEN(timerfd_settime),		"timerfd_settime"	},
-[326] = { 2,	TD,		SEN(timerfd_gettime),		"timerfd_gettime"	},
-[327] = { 4,	TD|TS,		SEN(signalfd4),			"signalfd4"		},
-[328] = { 2,	TD,		SEN(eventfd2),			"eventfd2"		},
-[329] = { 1,	TD,		SEN(epoll_create1),		"epoll_create1"		},
-[330] = { 3,	TD,		SEN(dup3),			"dup3"			},
-[331] = { 2,	TD,		SEN(pipe2),			"pipe2"			},
-[332] = { 1,	TD,		SEN(inotify_init1),		"inotify_init1"		},
-[333] = { 5,	TD,		SEN(preadv),			"preadv"		},
-[334] = { 5,	TD,		SEN(pwritev),			"pwritev"		},
-[335] = { 2,	TD,		SEN(setns),			"setns"			},
-[336] = { 5,	TD|TF,		SEN(name_to_handle_at),		"name_to_handle_at"	},
-[337] = { 3,	TD,		SEN(open_by_handle_at),		"open_by_handle_at"	},
-[338] = { 4,	TP|TS,		SEN(rt_tgsigqueueinfo),		"rt_tgsigqueueinfo"	},
-[339] = { 5,	TD,		SEN(perf_event_open),		"perf_event_open"	},
-[340] = { 5,	TN,		SEN(recvmmsg),			"recvmmsg"		},
-[341] = { 4,	TN,		SEN(accept4),			"accept4"		},
-[342] = { 2,	TD,		SEN(fanotify_init),		"fanotify_init"		},
-[343] = { 6,	TD|TF,		SEN(fanotify_mark),		"fanotify_mark"		},
-[344] = { 4,	0,		SEN(prlimit64),			"prlimit64"		},
-[345] = { 2,	0,		SEN(clock_adjtime),		"clock_adjtime"		},
-[346] = { 1,	TD,		SEN(syncfs),			"syncfs"		},
-[347] = { 4,	TN,		SEN(sendmmsg),			"sendmmsg"		},
-[348] = { 6,	0,		SEN(process_vm_readv),		"process_vm_readv"	},
-[349] = { 6,	0,		SEN(process_vm_writev),		"process_vm_writev"	},
-[350] = { 5,	0,		SEN(kcmp),			"kcmp"			},
-[351] = { 3,	TD,		SEN(finit_module),		"finit_module"		},
-[352] = { 3,	0,		SEN(sched_setattr),		"sched_setattr"		},
-[353] = { 4,	0,		SEN(sched_getattr),		"sched_getattr"		},
-[354] = { 5,	TD|TF,		SEN(renameat2),			"renameat2"		},
-[355] = { 3,	0,		SEN(seccomp),			"seccomp"		},
-[356] = { 3,	0,		SEN(getrandom),			"getrandom"		},
-[357] = { 2,	TD,		SEN(memfd_create),		"memfd_create"		},
-[358] = { 3,	TD,		SEN(bpf),			"bpf"			},
-[359] = { 5,	TD|TF|TP|SE|SI,	SEN(execveat),			"execveat"		},
-
-#define SYS_socket_subcall	400
-#include "subcall.h"
diff --git a/linux/crisv10/userent.h b/linux/crisv10/userent.h
deleted file mode 100644
index bea16ae..0000000
--- a/linux/crisv10/userent.h
+++ /dev/null
@@ -1,26 +0,0 @@
-XLAT(4*PT_FRAMETYPE),
-XLAT(4*PT_ORIG_R10),
-XLAT(4*PT_R13),
-XLAT(4*PT_R12),
-XLAT(4*PT_R11),
-XLAT(4*PT_R10),
-XLAT(4*PT_R9),
-XLAT(4*PT_R8),
-XLAT(4*PT_R7),
-XLAT(4*PT_R6),
-XLAT(4*PT_R5),
-XLAT(4*PT_R4),
-XLAT(4*PT_R3),
-XLAT(4*PT_R2),
-XLAT(4*PT_R1),
-XLAT(4*PT_R0),
-XLAT(4*PT_MOF),
-XLAT(4*PT_DCCR),
-XLAT(4*PT_SRP),
-XLAT(4*PT_IRP),
-XLAT(4*PT_CSRINSTR),
-XLAT(4*PT_CSRADDR),
-XLAT(4*PT_CSRDATA),
-XLAT(4*PT_USP),
-/* Other fields in "struct user" */
-#include "../userent0.h"
diff --git a/linux/crisv32/arch_regs.c b/linux/crisv32/arch_regs.c
deleted file mode 100644
index 8e59c15..0000000
--- a/linux/crisv32/arch_regs.c
+++ /dev/null
@@ -1,2 +0,0 @@
-#include "crisv10/arch_regs.c"
-#define ARCH_PC_PEEK_ADDR (4 * PT_ERP)
diff --git a/linux/crisv32/arch_rt_sigframe.c b/linux/crisv32/arch_rt_sigframe.c
deleted file mode 100644
index 2f45746..0000000
--- a/linux/crisv32/arch_rt_sigframe.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/arch_rt_sigframe.c"
diff --git a/linux/crisv32/arch_sigreturn.c b/linux/crisv32/arch_sigreturn.c
deleted file mode 100644
index 6c0fc03..0000000
--- a/linux/crisv32/arch_sigreturn.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/arch_sigreturn.c"
diff --git a/linux/crisv32/get_error.c b/linux/crisv32/get_error.c
deleted file mode 100644
index f7bb1e0..0000000
--- a/linux/crisv32/get_error.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/get_error.c"
diff --git a/linux/crisv32/get_scno.c b/linux/crisv32/get_scno.c
deleted file mode 100644
index edfd60f..0000000
--- a/linux/crisv32/get_scno.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/get_scno.c"
diff --git a/linux/crisv32/get_syscall_args.c b/linux/crisv32/get_syscall_args.c
deleted file mode 100644
index 4d98465..0000000
--- a/linux/crisv32/get_syscall_args.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/get_syscall_args.c"
diff --git a/linux/crisv32/get_syscall_result.c b/linux/crisv32/get_syscall_result.c
deleted file mode 100644
index ebefdb2..0000000
--- a/linux/crisv32/get_syscall_result.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/get_syscall_result.c"
diff --git a/linux/crisv32/rt_sigframe.h b/linux/crisv32/rt_sigframe.h
deleted file mode 100644
index bfe07d4..0000000
--- a/linux/crisv32/rt_sigframe.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/rt_sigframe.h"
diff --git a/linux/crisv32/set_error.c b/linux/crisv32/set_error.c
deleted file mode 100644
index 18a5ee8..0000000
--- a/linux/crisv32/set_error.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/set_error.c"
diff --git a/linux/crisv32/set_scno.c b/linux/crisv32/set_scno.c
deleted file mode 100644
index b021adf..0000000
--- a/linux/crisv32/set_scno.c
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/set_scno.c"
diff --git a/linux/crisv32/syscallent.h b/linux/crisv32/syscallent.h
deleted file mode 100644
index ce4e528..0000000
--- a/linux/crisv32/syscallent.h
+++ /dev/null
@@ -1 +0,0 @@
-#include "crisv10/syscallent.h"
diff --git a/linux/crisv32/userent.h b/linux/crisv32/userent.h
deleted file mode 100644
index 3c5949e..0000000
--- a/linux/crisv32/userent.h
+++ /dev/null
@@ -1,43 +0,0 @@
-XLAT(4*PT_ORIG_R10),
-XLAT(4*PT_R0),
-XLAT(4*PT_R1),
-XLAT(4*PT_R2),
-XLAT(4*PT_R3),
-XLAT(4*PT_R4),
-XLAT(4*PT_R5),
-XLAT(4*PT_R6),
-XLAT(4*PT_R7),
-XLAT(4*PT_R8),
-XLAT(4*PT_R9),
-XLAT(4*PT_R10),
-XLAT(4*PT_R11),
-XLAT(4*PT_R12),
-XLAT(4*PT_R13),
-XLAT(4*PT_ACR),
-XLAT(4*PT_SRS),
-XLAT(4*PT_MOF),
-XLAT(4*PT_SPC),
-XLAT(4*PT_CCS),
-XLAT(4*PT_SRP),
-XLAT(4*PT_ERP),
-XLAT(4*PT_EXS),
-XLAT(4*PT_EDA),
-XLAT(4*PT_USP),
-XLAT(4*PT_PPC),
-XLAT(4*PT_BP_CTRL),
-XLAT(4*PT_BP+4),
-XLAT(4*PT_BP+8),
-XLAT(4*PT_BP+12),
-XLAT(4*PT_BP+16),
-XLAT(4*PT_BP+20),
-XLAT(4*PT_BP+24),
-XLAT(4*PT_BP+28),
-XLAT(4*PT_BP+32),
-XLAT(4*PT_BP+36),
-XLAT(4*PT_BP+40),
-XLAT(4*PT_BP+44),
-XLAT(4*PT_BP+48),
-XLAT(4*PT_BP+52),
-XLAT(4*PT_BP+56),
-/* Other fields in "struct user" */
-#include "../userent0.h"
diff --git a/linux/hppa/arch_defs_.h b/linux/hppa/arch_defs_.h
new file mode 100644
index 0000000..3a9bc3b
--- /dev/null
+++ b/linux/hppa/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_SA_RESTORER 0
diff --git a/linux/hppa/arch_rt_sigframe.c b/linux/hppa/arch_rt_sigframe.c
index e3c62fa..aaf2ffe 100644
--- a/linux/hppa/arch_rt_sigframe.c
+++ b/linux/hppa/arch_rt_sigframe.c
@@ -36,6 +36,6 @@
 {
 	unsigned long addr;
 
-	return upeek(tcp->pid, 4 * 30, &addr)
+	return upeek(tcp, 4 * 30, &addr)
 		? 0 : (addr & ~1UL) - RT_SIGFRAME_SIZE;
 }
diff --git a/linux/hppa/get_scno.c b/linux/hppa/get_scno.c
index 7da2fc4..fb3ed56 100644
--- a/linux/hppa/get_scno.c
+++ b/linux/hppa/get_scno.c
@@ -2,5 +2,5 @@
 static int
 arch_get_scno(struct tcb *tcp)
 {
-	return upeek(tcp->pid, PT_GR20, &tcp->scno) < 0 ? -1 : 1;
+	return upeek(tcp, PT_GR20, &tcp->scno) < 0 ? -1 : 1;
 }
diff --git a/linux/hppa/get_syscall_args.c b/linux/hppa/get_syscall_args.c
index 2258ea8..aa938f5 100644
--- a/linux/hppa/get_syscall_args.c
+++ b/linux/hppa/get_syscall_args.c
@@ -5,7 +5,7 @@
 	unsigned int i;
 
 	for (i = 0; i < tcp->s_ent->nargs; ++i)
-		if (upeek(tcp->pid, PT_GR26-4*i, &tcp->u_arg[i]) < 0)
+		if (upeek(tcp, PT_GR26-4*i, &tcp->u_arg[i]) < 0)
 			return -1;
 	return 1;
 }
diff --git a/linux/hppa/get_syscall_result.c b/linux/hppa/get_syscall_result.c
index 0d15d4d..de2b882 100644
--- a/linux/hppa/get_syscall_result.c
+++ b/linux/hppa/get_syscall_result.c
@@ -1,5 +1,5 @@
 static int
 get_syscall_result_regs(struct tcb *tcp)
 {
-	return upeek(tcp->pid, PT_GR28, &hppa_r28) < 0 ? -1 : 0;
+	return upeek(tcp, PT_GR28, &hppa_r28) < 0 ? -1 : 0;
 }
diff --git a/linux/hppa/set_error.c b/linux/hppa/set_error.c
index 92a7979..edaada7 100644
--- a/linux/hppa/set_error.c
+++ b/linux/hppa/set_error.c
@@ -2,12 +2,12 @@
 arch_set_error(struct tcb *tcp)
 {
 	hppa_r28 = -tcp->u_error;
-	return upoke(tcp->pid, PT_GR28, hppa_r28);
+	return upoke(tcp, PT_GR28, hppa_r28);
 }
 
 static int
 arch_set_success(struct tcb *tcp)
 {
 	hppa_r28 = tcp->u_rval;
-	return upoke(tcp->pid, PT_GR28, hppa_r28);
+	return upoke(tcp, PT_GR28, hppa_r28);
 }
diff --git a/linux/hppa/set_scno.c b/linux/hppa/set_scno.c
index d4d873b..fcf8f43 100644
--- a/linux/hppa/set_scno.c
+++ b/linux/hppa/set_scno.c
@@ -1,5 +1,5 @@
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	return upoke(tcp->pid, PT_GR20, scno);
+	return upoke(tcp, PT_GR20, scno);
 }
diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h
index 8925338..70fe690 100644
--- a/linux/hppa/syscallent.h
+++ b/linux/hppa/syscallent.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2001 Hewlett-Packard, Matthew Wilcox
- * Copyright (c) 2001-2017 The strace developers.
+ * Copyright (c) 2001-2018 The strace developers.
  */
 
 [  0] = { 0,	0,		SEN(restart_syscall),		"restart_syscall"	},
@@ -23,11 +23,11 @@
 [ 17] = { 3,	TN,		SEN(socket),			"socket"		},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(stat),			"stat"			},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 3,	TN,		SEN(bind),			"bind"			},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -50,10 +50,10 @@
 [ 44] = { 3,	TN,		SEN(getsockname),		"getsockname"		},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 3,	TN,		SEN(getpeername),		"getpeername"		},
@@ -67,8 +67,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -209,7 +209,7 @@
 [203] = { 5,	0,		SEN(printargs),			"attrctl"		},
 [204] = { 5,	0,		SEN(printargs),			"acl_get"		},
 [205] = { 5,	0,		SEN(printargs),			"acl_set"		},
-[206] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[206] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [207] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile64"		},
@@ -232,12 +232,12 @@
 [226] = { 4,	TD,		SEN(epoll_wait),		"epoll_wait"		},
 [227] = { 5,	TM|SI,		SEN(remap_file_pages),		"remap_file_pages"	},
 [228] = { 4,	TI,		SEN(semtimedop),		"semtimedop"		},
-[229] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[229] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [230] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[231] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[232] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[233] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[234] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[231] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[232] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[233] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[234] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [235] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [236] = { 6,	TD,		SEN(fadvise64_64),		"fadvise64_64"		},
 [237] = { 1,	0,		SEN(set_tid_address),		"set_tid_address"	},
diff --git a/linux/i386/arch_defs_.h b/linux/i386/arch_defs_.h
new file mode 100644
index 0000000..a8e961f
--- /dev/null
+++ b/linux/i386/arch_defs_.h
@@ -0,0 +1,3 @@
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/linux/i386/arch_kvm.c b/linux/i386/arch_kvm.c
new file mode 100644
index 0000000..e8e982e
--- /dev/null
+++ b/linux/i386/arch_kvm.c
@@ -0,0 +1 @@
+#include "x86_64/arch_kvm.c"
diff --git a/linux/i386/set_error.c b/linux/i386/set_error.c
index 92b0a8d..7d47e28 100644
--- a/linux/i386/set_error.c
+++ b/linux/i386/set_error.c
@@ -3,7 +3,7 @@
 {
 	i386_regs.eax = -tcp->u_error;
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, 4 * EAX, i386_regs.eax);
+	return upoke(tcp, 4 * EAX, i386_regs.eax);
 #else
 	return set_regs(tcp->pid);
 #endif
@@ -14,7 +14,7 @@
 {
 	i386_regs.eax = tcp->u_rval;
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, 4 * EAX, i386_regs.eax);
+	return upoke(tcp, 4 * EAX, i386_regs.eax);
 #else
 	return set_regs(tcp->pid);
 #endif
diff --git a/linux/i386/set_scno.c b/linux/i386/set_scno.c
index 3abe776..67736ea 100644
--- a/linux/i386/set_scno.c
+++ b/linux/i386/set_scno.c
@@ -2,7 +2,7 @@
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, 4 * ORIG_EAX, scno);
+	return upoke(tcp, 4 * ORIG_EAX, scno);
 #else
 	i386_regs.orig_eax = scno;
 	return set_regs(tcp->pid);
diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
index 6c5725a..b00e1d8 100644
--- a/linux/i386/syscallent.h
+++ b/linux/i386/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -226,10 +226,10 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(getegid),			"getegid32"		},
+[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF,		SEN(getegid),			"getegid32"		},
 [203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
 [204] = { 2,	0,		SEN(setregid),			"setregid32"		},
 [205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
@@ -250,7 +250,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[224] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -303,12 +303,12 @@
 [274] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [275] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [276] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[277] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[277] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [278] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[279] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[280] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[281] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[282] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[279] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[280] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[281] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[282] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [283] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [284] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [285] = { }, /* sys_setaltroot */
diff --git a/linux/ia64/arch_defs_.h b/linux/ia64/arch_defs_.h
new file mode 100644
index 0000000..8674172
--- /dev/null
+++ b/linux/ia64/arch_defs_.h
@@ -0,0 +1,4 @@
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 0
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/ia64/arch_regs.c b/linux/ia64/arch_regs.c
index deec176..b79918e 100644
--- a/linux/ia64/arch_regs.c
+++ b/linux/ia64/arch_regs.c
@@ -1,8 +1,5 @@
 static struct pt_all_user_regs ia64_regs;
 unsigned long *const ia64_frame_ptr = &ia64_regs.gr[12];
 
-#define IA64_PSR_IS	(1UL << 34)
-#define ia64_ia32mode	(ia64_regs.cr_ipsr & IA64_PSR_IS)
-
 #define ARCH_REGS_FOR_GETREGS ia64_regs
 #define ARCH_PC_REG ia64_regs.br[0]
diff --git a/linux/ia64/get_error.c b/linux/ia64/get_error.c
index 41cae92..6111077 100644
--- a/linux/ia64/get_error.c
+++ b/linux/ia64/get_error.c
@@ -3,20 +3,10 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (ia64_ia32mode) {
-		int err = ia64_regs.gr[8];
-		if (check_errno && is_negated_errno(err)) {
-			tcp->u_rval = -1;
-			tcp->u_error = -err;
-		} else {
-			tcp->u_rval = err;
-		}
+	if (ia64_regs.gr[10]) {
+		tcp->u_rval = -1;
+		tcp->u_error = ia64_regs.gr[8];
 	} else {
-		if (ia64_regs.gr[10]) {
-			tcp->u_rval = -1;
-			tcp->u_error = ia64_regs.gr[8];
-		} else {
-			tcp->u_rval = ia64_regs.gr[8];
-		}
+		tcp->u_rval = ia64_regs.gr[8];
 	}
 }
diff --git a/linux/ia64/get_scno.c b/linux/ia64/get_scno.c
index 0ddc17a..88f2cad 100644
--- a/linux/ia64/get_scno.c
+++ b/linux/ia64/get_scno.c
@@ -2,6 +2,6 @@
 static int
 arch_get_scno(struct tcb *tcp)
 {
-	tcp->scno = ia64_ia32mode ? ia64_regs.gr[0] : ia64_regs.gr[15];
+	tcp->scno = ia64_regs.gr[15];
 	return 1;
 }
diff --git a/linux/ia64/get_syscall_args.c b/linux/ia64/get_syscall_args.c
index 1b942eb..ad73c54 100644
--- a/linux/ia64/get_syscall_args.c
+++ b/linux/ia64/get_syscall_args.c
@@ -1,29 +1,26 @@
+#include <asm/rse.h>
+
 /* Return -1 on error or 1 on success (never 0!). */
 static int
 get_syscall_args(struct tcb *tcp)
 {
-	if (!ia64_ia32mode) {
-		unsigned long *rbs_end =
-			(unsigned long *) ia64_regs.ar[PT_AUR_BSP];
-		unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f;
-		unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f;
-		unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
-		unsigned int i;
+	unsigned long *rbs_end =
+		(unsigned long *) ia64_regs.ar[PT_AUR_BSP];
+	unsigned long sof = (ia64_regs.cfm >> 0) & 0x7f;
+	unsigned long sol = (ia64_regs.cfm >> 7) & 0x7f;
+	unsigned long *out0 = ia64_rse_skip_regs(rbs_end, -sof + sol);
+	unsigned int i;
 
-		for (i = 0; i < tcp->s_ent->nargs; ++i) {
-			if (umove(tcp,
-				  (unsigned long) ia64_rse_skip_regs(out0, i),
-				  &tcp->u_arg[i]) < 0)
+	for (i = 0; i < tcp->s_ent->nargs; ++i) {
+		if (umove(tcp,
+			  (unsigned long) ia64_rse_skip_regs(out0, i),
+			  &tcp->u_arg[i]) < 0) {
+			if (errno == EPERM)
+				tcp->u_arg[i] = 0;
+			else
 				return -1;
 		}
-	} else {
-		/* truncate away IVE sign-extension */
-		tcp->u_arg[0] = 0xffffffff & ia64_regs.gr[11]; /* EBX */
-		tcp->u_arg[1] = 0xffffffff & ia64_regs.gr[ 9]; /* ECX */
-		tcp->u_arg[2] = 0xffffffff & ia64_regs.gr[10]; /* EDX */
-		tcp->u_arg[3] = 0xffffffff & ia64_regs.gr[14]; /* ESI */
-		tcp->u_arg[4] = 0xffffffff & ia64_regs.gr[15]; /* EDI */
-		tcp->u_arg[5] = 0xffffffff & ia64_regs.gr[13]; /* EBP */
 	}
+
 	return 1;
 }
diff --git a/linux/ia64/set_error.c b/linux/ia64/set_error.c
index c566b63..6934499 100644
--- a/linux/ia64/set_error.c
+++ b/linux/ia64/set_error.c
@@ -1,12 +1,9 @@
 static int
 arch_set_error(struct tcb *tcp)
 {
-	if (ia64_ia32mode) {
-		ia64_regs.gr[8] = -tcp->u_error;
-	} else {
-		ia64_regs.gr[8] = tcp->u_error;
-		ia64_regs.gr[10] = -1;
-	}
+	ia64_regs.gr[8] = tcp->u_error;
+	ia64_regs.gr[10] = -1;
+
 	return set_regs(tcp->pid);
 }
 
@@ -14,8 +11,7 @@
 arch_set_success(struct tcb *tcp)
 {
 	ia64_regs.gr[8] = tcp->u_rval;
-	if (!ia64_ia32mode) {
-		ia64_regs.gr[10] = 0;
-	}
+	ia64_regs.gr[10] = 0;
+
 	return set_regs(tcp->pid);
 }
diff --git a/linux/ia64/set_scno.c b/linux/ia64/set_scno.c
index 1af7b02..8e0f9c4 100644
--- a/linux/ia64/set_scno.c
+++ b/linux/ia64/set_scno.c
@@ -1,10 +1,7 @@
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	if (ia64_ia32mode)
-		ia64_regs.gr[0] = scno;
-	else
-		ia64_regs.gr[15] = scno;
+	ia64_regs.gr[15] = scno;
 
 	return set_regs(tcp->pid);
 }
diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h
index 7ca4e39..33b3e8d 100644
--- a/linux/ia64/syscallent.h
+++ b/linux/ia64/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1999, 2001 Hewlett-Packard Co
  *                          David Mosberger-Tang <davidm@hpl.hp.com>
- * Copyright (c) 2000-2017 The strace developers.
+ * Copyright (c) 2000-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -59,13 +59,13 @@
 [1038] = { 2,	TF,		SEN(chmod),			"chmod"			},
 [1039] = { 3,	TF,		SEN(chown),			"chown"			},
 [1040] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[1041] = { 0,	NF,		SEN(getpid),			"getpid"		},
-[1042] = { 0,	NF,		SEN(getppid),			"getppid"		},
+[1041] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
+[1042] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
 [1043] = { 5,	TF,		SEN(mount),			"mount"			},
 [1044] = { 2,	TF,		SEN(umount2),			"umount"		},
 [1045] = { 1,	0,		SEN(setuid),			"setuid"		},
-[1046] = { 0,	NF,		SEN(getuid),			"getuid"		},
-[1047] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
+[1046] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
+[1047] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
 [1048] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [1049] = { 2,	TF,		SEN(access),			"access"		},
 [1050] = { 0,	0,		SEN(sync),			"sync"			},
@@ -80,8 +80,8 @@
 [1059] = { 1,	0,		SEN(times),			"times"			},
 [1060] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [1061] = { 1,	0,		SEN(setgid),			"setgid"		},
-[1062] = { 0,	NF,		SEN(getgid),			"getgid"		},
-[1063] = { 0,	NF,		SEN(getegid),			"getegid"		},
+[1062] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
+[1063] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
 [1064] = { 1,	TF,		SEN(acct),			"acct"			},
 [1065] = { 3,	TD,		SEN(ioctl),			"ioctl"			},
 [1066] = { 3,	TD,		SEN(fcntl),			"fcntl"			},
@@ -123,7 +123,7 @@
 [1102] = { 3,	0,		SEN(setpriority),		"setpriority"		},
 [1103] = { 2,	TF|TSF|TSFA,	SEN(statfs),			"statfs"		},
 [1104] = { 2,	TD|TFSF|TSFA,	SEN(fstatfs),			"fstatfs"		},
-[1105] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[1105] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [1106] = { 3,	TI,		SEN(semget),			"semget"		},
 [1107] = { 3,	TI,		SEN(semop),			"semop"			},
 [1108] = { 4,	TI,		SEN(semctl),			"semctl"		},
@@ -189,7 +189,7 @@
 [1168] = { 2,	0,		SEN(nanosleep),			"nanosleep"		},
 [1169] = { 3,	0,		SEN(nfsservctl),		"nfsservctl"		},
 [1170] = { 5,	0,		SEN(prctl),			"prctl"			},
-[1171] = { 0,	0,		SEN(getpagesize),		"getpagesize"		},
+[1171] = { 0,	PU|NF,		SEN(getpagesize),		"getpagesize"		},
 [1172] = { 6,	TD|TM|SI,	SEN(mmap_pgoff),		"mmap2"			},
 [1173] = { 5,	0,		SEN(printargs),			"pciconfig_read"	},
 [1174] = { 5,	0,		SEN(printargs),			"pciconfig_write"	},
@@ -280,12 +280,12 @@
 [1259] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [1260] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [1261] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[1262] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[1262] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [1263] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[1264] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[1265] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[1266] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[1267] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[1264] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[1265] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[1266] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[1267] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [1268] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [1269] = { 5,	0,		SEN(vserver),			"vserver"		},
 [1270] = { 5,	TP,		SEN(waitid),			"waitid"		},
diff --git a/linux/m68k/arch_defs_.h b/linux/m68k/arch_defs_.h
new file mode 100644
index 0000000..67e815c
--- /dev/null
+++ b/linux/m68k/arch_defs_.h
@@ -0,0 +1,4 @@
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define HAVE_ARCH_SA_RESTORER 1
diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h
index dc532c7..b8bad1b 100644
--- a/linux/m68k/syscallent.h
+++ b/linux/m68k/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -193,7 +193,7 @@
 [163] = { 5,	TM|SI,		SEN(mremap),			"mremap"		},
 [164] = { 3,	0,		SEN(setresuid16),		"setresuid"		},
 [165] = { 3,	0,		SEN(getresuid16),		"getresuid"		},
-[166] = { 0,	0,		SEN(getpagesize),		"getpagesize"		},
+[166] = { 0,	PU|NF,		SEN(getpagesize),		"getpagesize"		},
 [167] = { 5,	0,		SEN(query_module),		"query_module"		},
 [168] = { 3,	TD,		SEN(poll),			"poll"			},
 [169] = { 3,	0,		SEN(nfsservctl),		"nfsservctl"		},
@@ -226,10 +226,10 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"chown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(geteuid),			"getegid32"		},
+[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF,		SEN(geteuid),			"getegid32"		},
 [203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
 [204] = { 2,	0,		SEN(setregid),			"setregid32"		},
 [205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
@@ -247,7 +247,7 @@
 [217] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
 [218 ... 219] = { },
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
-[221] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[221] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [222] = { 2,	TS,		SEN(kill),			"tkill"			},
 [223] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [224] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -297,12 +297,12 @@
 [268] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [269] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [270] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[271] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[271] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [272] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[273] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[274] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[275] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[276] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[273] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[274] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[275] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[276] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [277] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [278] = { 5,	0,		SEN(vserver),			"vserver"		},
 [279] = { 5,	0,		SEN(add_key),			"add_key"		},
@@ -359,7 +359,7 @@
 [330] = { 5,	TD,		SEN(pwritev),			"pwritev"		},
 [331] = { 4,	TP|TS,		SEN(rt_tgsigqueueinfo),		"rt_tgsigqueueinfo"	},
 [332] = { 5,	TD,		SEN(perf_event_open),		"perf_event_open"	},
-[333] = { 0,	0,		SEN(get_thread_area),		"get_thread_area"	},
+[333] = { 0,	PU|NF,		SEN(get_thread_area),		"get_thread_area"	},
 [334] = { 1,	0,		SEN(set_thread_area),		"set_thread_area"	},
 [335] = { 6,	0,		SEN(printargs),			"atomic_cmpxchg_32"	},
 [336] = { 0,	0,		SEN(printargs),			"atomic_barrier"	},
diff --git a/linux/metag/syscallent.h b/linux/metag/syscallent.h
index 82ad55b..723cfe3 100644
--- a/linux/metag/syscallent.h
+++ b/linux/metag/syscallent.h
@@ -3,4 +3,4 @@
 [245] = { 2,	0,	SEN(printargs),	"metag_setglobalbit"	},
 [246] = { 1,	0,	SEN(printargs),	"metag_set_fpu_flags"	},
 [247] = { 1,	0,	SEN(printargs),	"metag_set_tls"		},
-[248] = { 0,	NF,	SEN(printargs),	"metag_get_tls"		},
+[248] = { 0,	PU|NF,	SEN(printargs),	"metag_get_tls"		},
diff --git a/linux/microblaze/arch_defs_.h b/linux/microblaze/arch_defs_.h
new file mode 100644
index 0000000..d642058
--- /dev/null
+++ b/linux/microblaze/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/linux/microblaze/arch_rt_sigframe.c b/linux/microblaze/arch_rt_sigframe.c
index 10d03db..dcecd1a 100644
--- a/linux/microblaze/arch_rt_sigframe.c
+++ b/linux/microblaze/arch_rt_sigframe.c
@@ -29,5 +29,5 @@
 {
 	unsigned long addr;
 
-	return upeek(tcp->pid, 4 * 1, &addr) ? 0 : addr;
+	return upeek(tcp, 4 * 1, &addr) ? 0 : addr;
 }
diff --git a/linux/microblaze/arch_sigreturn.c b/linux/microblaze/arch_sigreturn.c
index 6e4343a..2792073 100644
--- a/linux/microblaze/arch_sigreturn.c
+++ b/linux/microblaze/arch_sigreturn.c
@@ -6,7 +6,7 @@
 	unsigned long addr;
 
 	/* Read r1, the stack pointer.  */
-	if (upeek(tcp->pid, 1 * 4, &addr) < 0)
+	if (upeek(tcp, 1 * 4, &addr) < 0)
 		return;
 	addr += offsetof(struct sigcontext, oldmask);
 
diff --git a/linux/microblaze/get_scno.c b/linux/microblaze/get_scno.c
index 6f98f83..6c11cd4 100644
--- a/linux/microblaze/get_scno.c
+++ b/linux/microblaze/get_scno.c
@@ -2,5 +2,5 @@
 static int
 arch_get_scno(struct tcb *tcp)
 {
-	return upeek(tcp->pid, 0, &tcp->scno) < 0 ? -1 : 1;
+	return upeek(tcp, 0, &tcp->scno) < 0 ? -1 : 1;
 }
diff --git a/linux/microblaze/get_syscall_args.c b/linux/microblaze/get_syscall_args.c
index 830c8c3..1a3a48f 100644
--- a/linux/microblaze/get_syscall_args.c
+++ b/linux/microblaze/get_syscall_args.c
@@ -5,7 +5,7 @@
 	unsigned int i;
 
 	for (i = 0; i < tcp->s_ent->nargs; ++i)
-		if (upeek(tcp->pid, (5 + i) * 4, &tcp->u_arg[i]) < 0)
+		if (upeek(tcp, (5 + i) * 4, &tcp->u_arg[i]) < 0)
 			return -1;
 	return 1;
 }
diff --git a/linux/microblaze/get_syscall_result.c b/linux/microblaze/get_syscall_result.c
index 9ece53e..5b593a4 100644
--- a/linux/microblaze/get_syscall_result.c
+++ b/linux/microblaze/get_syscall_result.c
@@ -1,5 +1,5 @@
 static int
 get_syscall_result_regs(struct tcb *tcp)
 {
-	return upeek(tcp->pid, 3 * 4, &microblaze_r3) < 0 ? -1 : 0;
+	return upeek(tcp, 3 * 4, &microblaze_r3) < 0 ? -1 : 0;
 }
diff --git a/linux/microblaze/set_error.c b/linux/microblaze/set_error.c
index 4686671..5bb83b5 100644
--- a/linux/microblaze/set_error.c
+++ b/linux/microblaze/set_error.c
@@ -2,12 +2,12 @@
 arch_set_error(struct tcb *tcp)
 {
 	microblaze_r3 = -tcp->u_error;
-	return upoke(tcp->pid, 3 * 4, microblaze_r3);
+	return upoke(tcp, 3 * 4, microblaze_r3);
 }
 
 static int
 arch_set_success(struct tcb *tcp)
 {
 	microblaze_r3 = tcp->u_rval;
-	return upoke(tcp->pid, 3 * 4, microblaze_r3);
+	return upoke(tcp, 3 * 4, microblaze_r3);
 }
diff --git a/linux/microblaze/set_scno.c b/linux/microblaze/set_scno.c
index b9cddef..4f69a52 100644
--- a/linux/microblaze/set_scno.c
+++ b/linux/microblaze/set_scno.c
@@ -1,5 +1,5 @@
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	return upoke(tcp->pid, 0, scno);
+	return upoke(tcp, 0, scno);
 }
diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h
index 4c7b9ad..4c645f4 100644
--- a/linux/microblaze/syscallent.h
+++ b/linux/microblaze/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -226,10 +226,10 @@
 [196] = { 2,	TF|TLST|TSTA,	SEN(lstat64),			"lstat64"		},
 [197] = { 2,	TD|TFST|TSTA,	SEN(fstat64),			"fstat64"		},
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
-[199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
-[200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	NF,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	NF,		SEN(geteuid),			"getegid32"		},
+[199] = { 0,	PU|NF,		SEN(getuid),			"getuid32"		},
+[200] = { 0,	PU|NF,		SEN(getgid),			"getgid32"		},
+[201] = { 0,	PU|NF,		SEN(geteuid),			"geteuid32"		},
+[202] = { 0,	PU|NF,		SEN(geteuid),			"getegid32"		},
 [203] = { 2,	0,		SEN(setreuid),			"setreuid32"		},
 [204] = { 2,	0,		SEN(setregid),			"setregid32"		},
 [205] = { 2,	0,		SEN(getgroups),			"getgroups32"		},
@@ -250,7 +250,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[224] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -303,12 +303,12 @@
 [274] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [275] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [276] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[277] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[277] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [278] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[279] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[280] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[281] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[282] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[279] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[280] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[281] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[282] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [283] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [284] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [285] = { },
diff --git a/linux/mips/arch_defs_.h b/linux/mips/arch_defs_.h
new file mode 100644
index 0000000..f6fe59e
--- /dev/null
+++ b/linux/mips/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_GETRVAL2 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h
index 748e09c..c7d35ad 100644
--- a/linux/mips/syscallent-n32.h
+++ b/linux/mips/syscallent-n32.h
@@ -234,12 +234,12 @@
 [6231] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [6232] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [6233] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[6234] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[6234] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [6235] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[6236] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[6237] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[6238] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[6239] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[6236] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[6237] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[6238] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[6239] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [6240] = { 5,	0,		SEN(vserver),			"vserver"		},
 [6241] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [6242] = { },
diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h
index cc09366..3e55848 100644
--- a/linux/mips/syscallent-n64.h
+++ b/linux/mips/syscallent-n64.h
@@ -230,12 +230,12 @@
 [5227] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [5228] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [5229] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[5230] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[5230] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [5231] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[5232] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[5233] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[5234] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[5235] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[5232] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[5233] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[5234] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[5235] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [5236] = { 5,	0,		SEN(vserver),			"vserver"		},
 [5237] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [5238] = { },
diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h
index 5ac79b5..4041907 100644
--- a/linux/mips/syscallent-o32.h
+++ b/linux/mips/syscallent-o32.h
@@ -1,5 +1,6 @@
 #if defined LINUX_MIPSO32
 /* For an O32 strace, decode the o32 syscalls.  */
+# define SYS_syscall_subcall	4000
 [4000] = { MA,	0,		SEN(syscall),			"syscall"		}, /* start of Linux o32 */
 [4001] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [4002] = { 0,	TP,		SEN(fork),			"fork"			},
@@ -271,12 +272,12 @@
 [4268] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [4269] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [4270] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[4271] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[4271] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [4272] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[4273] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[4274] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[4275] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[4276] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[4273] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[4274] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[4275] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[4276] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [4277] = { 5,	0,		SEN(vserver),			"vserver"		},
 [4278] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [4279] = { },
diff --git a/linux/mtd-abi.h b/linux/mtd-abi.h
deleted file mode 100644
index a63a99a..0000000
--- a/linux/mtd-abi.h
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * Copyright (c) 1999-2010 David Woodhouse <dwmw2@infradead.org> et al.
- * Copyright (c) 2010-2017 The strace developers.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
- *
- */
-
-#ifndef __MTD_ABI_H__
-#define __MTD_ABI_H__
-
-#include <linux/types.h>
-
-struct erase_info_user {
-	__u32 start;
-	__u32 length;
-};
-
-struct erase_info_user64 {
-	__u64 start;
-	__u64 length;
-};
-
-struct mtd_oob_buf {
-	__u32 start;
-	__u32 length;
-	unsigned char *ptr;
-};
-
-struct mtd_oob_buf64 {
-	__u64 start;
-	__u32 pad;
-	__u32 length;
-	__u64 usr_ptr;
-};
-
-/**
- * MTD operation modes
- *
- * @MTD_OPS_PLACE_OOB:	OOB data are placed at the given offset (default)
- * @MTD_OPS_AUTO_OOB:	OOB data are automatically placed at the free areas
- *			which are defined by the internal ecclayout
- * @MTD_OPS_RAW:	data are transferred as-is, with no error correction;
- *			this mode implies %MTD_OPS_PLACE_OOB
- *
- * These modes can be passed to ioctl(MEMWRITE) and are also used internally.
- * See notes on "MTD file modes" for discussion on %MTD_OPS_RAW vs.
- * %MTD_FILE_MODE_RAW.
- */
-enum {
-	MTD_OPS_PLACE_OOB = 0,
-	MTD_OPS_AUTO_OOB = 1,
-	MTD_OPS_RAW = 2,
-};
-
-/**
- * struct mtd_write_req - data structure for requesting a write operation
- *
- * @start:	start address
- * @len:	length of data buffer
- * @ooblen:	length of OOB buffer
- * @usr_data:	user-provided data buffer
- * @usr_oob:	user-provided OOB buffer
- * @mode:	MTD mode (see "MTD operation modes")
- * @padding:	reserved, must be set to 0
- *
- * This structure supports ioctl(MEMWRITE) operations, allowing data and/or OOB
- * writes in various modes. To write to OOB-only, set @usr_data == NULL, and to
- * write data-only, set @usr_oob == NULL. However, setting both @usr_data and
- * @usr_oob to NULL is not allowed.
- */
-struct mtd_write_req {
-	__u64 start;
-	__u64 len;
-	__u64 ooblen;
-	__u64 usr_data;
-	__u64 usr_oob;
-	__u8 mode;
-	__u8 padding[7];
-};
-
-#define MTD_ABSENT		0
-#define MTD_RAM			1
-#define MTD_ROM			2
-#define MTD_NORFLASH		3
-#define MTD_NANDFLASH		4
-#define MTD_DATAFLASH		6
-#define MTD_UBIVOLUME		7
-#define MTD_MLCNANDFLASH	8
-
-#define MTD_WRITEABLE		0x400	/* Device is writeable */
-#define MTD_BIT_WRITEABLE	0x800	/* Single bits can be flipped */
-#define MTD_NO_ERASE		0x1000	/* No erase necessary */
-#define MTD_POWERUP_LOCK	0x2000	/* Always locked after reset */
-
-/* Some common devices / combinations of capabilities */
-#define MTD_CAP_ROM		0
-#define MTD_CAP_RAM		(MTD_WRITEABLE | MTD_BIT_WRITEABLE | MTD_NO_ERASE)
-#define MTD_CAP_NORFLASH	(MTD_WRITEABLE | MTD_BIT_WRITEABLE)
-#define MTD_CAP_NANDFLASH	(MTD_WRITEABLE)
-
-/* Obsolete ECC byte placement modes (used with obsolete MEMGETOOBSEL) */
-#define MTD_NANDECC_OFF		0	// Switch off ECC (Not recommended)
-#define MTD_NANDECC_PLACE	1	// Use the given placement in the structure (YAFFS1 legacy mode)
-#define MTD_NANDECC_AUTOPLACE	2	// Use the default placement scheme
-#define MTD_NANDECC_PLACEONLY	3	// Use the given placement in the structure (Do not store ecc result on read)
-#define MTD_NANDECC_AUTOPL_USR	4	// Use the given autoplacement scheme rather than using the default
-
-/* OTP mode selection */
-#define MTD_OTP_OFF		0
-#define MTD_OTP_FACTORY		1
-#define MTD_OTP_USER		2
-
-struct mtd_info_user {
-	__u8 type;
-	__u32 flags;
-	__u32 size;	/* Total size of the MTD */
-	__u32 erasesize;
-	__u32 writesize;
-	__u32 oobsize;	/* Amount of OOB data per block (e.g. 16) */
-	__u64 padding;	/* Old obsolete field; do not use */
-};
-
-struct region_info_user {
-	__u32 offset;		/* At which this region starts,
-				 * from the beginning of the MTD */
-	__u32 erasesize;	/* For this region */
-	__u32 numblocks;	/* Number of blocks in this region */
-	__u32 regionindex;
-};
-
-struct otp_info {
-	__u32 start;
-	__u32 length;
-	__u32 locked;
-};
-
-/*
- * Note, the following ioctl existed in the past and was removed:
- * #define MEMSETOOBSEL           _IOW('M', 9, struct nand_oobinfo)
- * Try to avoid adding a new ioctl with the same ioctl number.
- */
-
-/* Get basic MTD characteristics info (better to use sysfs) */
-#define MEMGETINFO		_IOR('M', 1, struct mtd_info_user)
-/* Erase segment of MTD */
-#define MEMERASE		_IOW('M', 2, struct erase_info_user)
-/* Write out-of-band data from MTD */
-#define MEMWRITEOOB		_IOWR('M', 3, struct mtd_oob_buf)
-/* Read out-of-band data from MTD */
-#define MEMREADOOB		_IOWR('M', 4, struct mtd_oob_buf)
-/* Lock a chip (for MTD that supports it) */
-#define MEMLOCK			_IOW('M', 5, struct erase_info_user)
-/* Unlock a chip (for MTD that supports it) */
-#define MEMUNLOCK		_IOW('M', 6, struct erase_info_user)
-/* Get the number of different erase regions */
-#define MEMGETREGIONCOUNT	_IOR('M', 7, int)
-/* Get information about the erase region for a specific index */
-#define MEMGETREGIONINFO	_IOWR('M', 8, struct region_info_user)
-/* Get info about OOB modes (e.g., RAW, PLACE, AUTO) - legacy interface */
-#define MEMGETOOBSEL		_IOR('M', 10, struct nand_oobinfo)
-/* Check if an eraseblock is bad */
-#define MEMGETBADBLOCK		_IOW('M', 11, __kernel_loff_t)
-/* Mark an eraseblock as bad */
-#define MEMSETBADBLOCK		_IOW('M', 12, __kernel_loff_t)
-/* Set OTP (One-Time Programmable) mode (factory vs. user) */
-#define OTPSELECT		_IOR('M', 13, int)
-/* Get number of OTP (One-Time Programmable) regions */
-#define OTPGETREGIONCOUNT	_IOW('M', 14, int)
-/* Get all OTP (One-Time Programmable) info about MTD */
-#define OTPGETREGIONINFO	_IOW('M', 15, struct otp_info)
-/* Lock a given range of user data (must be in mode %MTD_FILE_MODE_OTP_USER) */
-#define OTPLOCK			_IOR('M', 16, struct otp_info)
-/* Get ECC layout (deprecated) */
-#define ECCGETLAYOUT		_IOR('M', 17, struct nand_ecclayout_user)
-/* Get statistics about corrected/uncorrected errors */
-#define ECCGETSTATS		_IOR('M', 18, struct mtd_ecc_stats)
-/* Set MTD mode on a per-file-descriptor basis (see "MTD file modes") */
-#define MTDFILEMODE		_IO('M', 19)
-/* Erase segment of MTD (supports 64-bit address) */
-#define MEMERASE64		_IOW('M', 20, struct erase_info_user64)
-/* Write data to OOB (64-bit version) */
-#define MEMWRITEOOB64		_IOWR('M', 21, struct mtd_oob_buf64)
-/* Read data from OOB (64-bit version) */
-#define MEMREADOOB64		_IOWR('M', 22, struct mtd_oob_buf64)
-/* Check if chip is locked (for MTD that supports it) */
-#define MEMISLOCKED		_IOR('M', 23, struct erase_info_user)
-/*
- * Most generic write interface; can write in-band and/or out-of-band in various
- * modes (see "struct mtd_write_req"). This ioctl is not supported for flashes
- * without OOB, e.g., NOR flash.
- */
-#define MEMWRITE		_IOWR('M', 24, struct mtd_write_req)
-
-/*
- * Obsolete legacy interface. Keep it in order not to break userspace
- * interfaces
- */
-struct nand_oobinfo {
-	__u32 useecc;
-	__u32 eccbytes;
-	__u32 oobfree[8][2];
-	__u32 eccpos[32];
-};
-
-struct nand_oobfree {
-	__u32 offset;
-	__u32 length;
-};
-
-#define MTD_MAX_OOBFREE_ENTRIES	8
-#define MTD_MAX_ECCPOS_ENTRIES	64
-/*
- * OBSOLETE: ECC layout control structure. Exported to user-space via ioctl
- * ECCGETLAYOUT for backwards compatbility and should not be mistaken as a
- * complete set of ECC information. The ioctl truncates the larger internal
- * structure to retain binary compatibility with the static declaration of the
- * ioctl. Note that the "MTD_MAX_..._ENTRIES" macros represent the max size of
- * the user struct, not the MAX size of the internal struct nand_ecclayout.
- */
-struct nand_ecclayout_user {
-	__u32 eccbytes;
-	__u32 eccpos[MTD_MAX_ECCPOS_ENTRIES];
-	__u32 oobavail;
-	struct nand_oobfree oobfree[MTD_MAX_OOBFREE_ENTRIES];
-};
-
-/**
- * struct mtd_ecc_stats - error correction stats
- *
- * @corrected:	number of corrected bits
- * @failed:	number of uncorrectable errors
- * @badblocks:	number of bad blocks in this partition
- * @bbtblocks:	number of blocks reserved for bad block tables
- */
-struct mtd_ecc_stats {
-	__u32 corrected;
-	__u32 failed;
-	__u32 badblocks;
-	__u32 bbtblocks;
-};
-
-/*
- * MTD file modes - for read/write access to MTD
- *
- * @MTD_FILE_MODE_NORMAL:	OTP disabled, ECC enabled
- * @MTD_FILE_MODE_OTP_FACTORY:	OTP enabled in factory mode
- * @MTD_FILE_MODE_OTP_USER:	OTP enabled in user mode
- * @MTD_FILE_MODE_RAW:		OTP disabled, ECC disabled
- *
- * These modes can be set via ioctl(MTDFILEMODE). The mode mode will be retained
- * separately for each open file descriptor.
- *
- * Note: %MTD_FILE_MODE_RAW provides the same functionality as %MTD_OPS_RAW -
- * raw access to the flash, without error correction or autoplacement schemes.
- * Wherever possible, the MTD_OPS_* mode will override the MTD_FILE_MODE_* mode
- * (e.g., when using ioctl(MEMWRITE)), but in some cases, the MTD_FILE_MODE is
- * used out of necessity (e.g., `write()', ioctl(MEMWRITEOOB64)).
- */
-enum mtd_file_modes {
-	MTD_FILE_MODE_NORMAL = MTD_OTP_OFF,
-	MTD_FILE_MODE_OTP_FACTORY = MTD_OTP_FACTORY,
-	MTD_FILE_MODE_OTP_USER = MTD_OTP_USER,
-	MTD_FILE_MODE_RAW,
-};
-
-#endif /* __MTD_ABI_H__ */
diff --git a/linux/nios2/arch_defs_.h b/linux/nios2/arch_defs_.h
new file mode 100644
index 0000000..2bd4e4a
--- /dev/null
+++ b/linux/nios2/arch_defs_.h
@@ -0,0 +1 @@
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/nr_prefix.c b/linux/nr_prefix.c
new file mode 100644
index 0000000..f22814f
--- /dev/null
+++ b/linux/nr_prefix.c
@@ -0,0 +1,11 @@
+/**
+ * Returns prefix for a syscall constant literal.  It is has to be that way
+ * thanks to ARM that decided to prefix their special system calls like sys32
+ * and sys26 with __ARM_NR_* prefix instead of __NR_*, so we can't simply print
+ * "__NR_".
+ */
+static inline const char *
+nr_prefix(kernel_ulong_t scno)
+{
+	return "__NR_";
+}
diff --git a/linux/personality.h b/linux/personality.h
deleted file mode 100644
index 09b35c6..0000000
--- a/linux/personality.h
+++ /dev/null
@@ -1,69 +0,0 @@
-#ifndef _LINUX_PERSONALITY_H
-#define _LINUX_PERSONALITY_H
-
-
-/*
- * Flags for bug emulation.
- *
- * These occupy the top three bytes.
- */
-enum {
-	UNAME26 =		0x0020000,
-	ADDR_NO_RANDOMIZE =	0x0040000,	/* disable randomization of VA space */
-	FDPIC_FUNCPTRS =	0x0080000,	/* userspace function ptrs point to descriptors
-						 * (signal handling)
-						 */
-	MMAP_PAGE_ZERO =	0x0100000,
-	ADDR_COMPAT_LAYOUT =	0x0200000,
-	READ_IMPLIES_EXEC =	0x0400000,
-	ADDR_LIMIT_32BIT =	0x0800000,
-	SHORT_INODE =		0x1000000,
-	WHOLE_SECONDS =		0x2000000,
-	STICKY_TIMEOUTS =	0x4000000,
-	ADDR_LIMIT_3GB =	0x8000000,
-};
-
-/*
- * Security-relevant compatibility flags that must be
- * cleared upon setuid or setgid exec:
- */
-#define PER_CLEAR_ON_SETID (READ_IMPLIES_EXEC  | \
-			    ADDR_NO_RANDOMIZE  | \
-			    ADDR_COMPAT_LAYOUT | \
-			    MMAP_PAGE_ZERO)
-
-/*
- * Personality types.
- *
- * These go in the low byte.  Avoid using the top bit, it will
- * conflict with error returns.
- */
-enum {
-	PER_LINUX =		0x0000,
-	PER_LINUX_32BIT =	0x0000 | ADDR_LIMIT_32BIT,
-	PER_LINUX_FDPIC =	0x0000 | FDPIC_FUNCPTRS,
-	PER_SVR4 =		0x0001 | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
-	PER_SVR3 =		0x0002 | STICKY_TIMEOUTS | SHORT_INODE,
-	PER_SCOSVR3 =		0x0003 | STICKY_TIMEOUTS |
-					 WHOLE_SECONDS | SHORT_INODE,
-	PER_OSR5 =		0x0003 | STICKY_TIMEOUTS | WHOLE_SECONDS,
-	PER_WYSEV386 =		0x0004 | STICKY_TIMEOUTS | SHORT_INODE,
-	PER_ISCR4 =		0x0005 | STICKY_TIMEOUTS,
-	PER_BSD =		0x0006,
-	PER_SUNOS =		0x0006 | STICKY_TIMEOUTS,
-	PER_XENIX =		0x0007 | STICKY_TIMEOUTS | SHORT_INODE,
-	PER_LINUX32 =		0x0008,
-	PER_LINUX32_3GB =	0x0008 | ADDR_LIMIT_3GB,
-	PER_IRIX32 =		0x0009 | STICKY_TIMEOUTS,/* IRIX5 32-bit */
-	PER_IRIXN32 =		0x000a | STICKY_TIMEOUTS,/* IRIX6 new 32-bit */
-	PER_IRIX64 =		0x000b | STICKY_TIMEOUTS,/* IRIX6 64-bit */
-	PER_RISCOS =		0x000c,
-	PER_SOLARIS =		0x000d | STICKY_TIMEOUTS,
-	PER_UW7 =		0x000e | STICKY_TIMEOUTS | MMAP_PAGE_ZERO,
-	PER_OSF4 =		0x000f,			 /* OSF/1 v4 */
-	PER_HPUX =		0x0010,
-	PER_MASK =		0x00ff,
-};
-
-
-#endif /* _LINUX_PERSONALITY_H */
diff --git a/linux/powerpc/arch_defs_.h b/linux/powerpc/arch_defs_.h
new file mode 100644
index 0000000..ef3f342
--- /dev/null
+++ b/linux/powerpc/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_OLD_SELECT 1
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/powerpc/getregs_old.c b/linux/powerpc/getregs_old.c
index 1730f03..4485ca6 100644
--- a/linux/powerpc/getregs_old.c
+++ b/linux/powerpc/getregs_old.c
@@ -3,29 +3,29 @@
  * we provide a slow fallback for old kernels.
  */
 static int
-getregs_old(pid_t pid)
+getregs_old(struct tcb *tcp)
 {
 	int i;
 	long r;
 
 	if (iflag) {
-		r = upeek(pid, sizeof(long) * PT_NIP, &ppc_regs.nip);
+		r = upeek(tcp, sizeof(long) * PT_NIP, &ppc_regs.nip);
 		if (r)
 			goto out;
 	}
 #ifdef POWERPC64 /* else we never use it */
-	r = upeek(pid, sizeof(long) * PT_MSR, &ppc_regs.msr);
+	r = upeek(tcp, sizeof(long) * PT_MSR, &ppc_regs.msr);
 	if (r)
 		goto out;
 #endif
-	r = upeek(pid, sizeof(long) * PT_CCR, &ppc_regs.ccr);
+	r = upeek(tcp, sizeof(long) * PT_CCR, &ppc_regs.ccr);
 	if (r)
 		goto out;
-	r = upeek(pid, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3);
+	r = upeek(tcp, sizeof(long) * PT_ORIG_R3, &ppc_regs.orig_gpr3);
 	if (r)
 		goto out;
 	for (i = 0; i <= 8; i++) {
-		r = upeek(pid, sizeof(long) * (PT_R0 + i),
+		r = upeek(tcp, sizeof(long) * (PT_R0 + i),
 			  &ppc_regs.gpr[i]);
 		if (r)
 			goto out;
diff --git a/linux/powerpc/ioctls_arch0.h b/linux/powerpc/ioctls_arch0.h
index e922ec0..f6f3b26 100644
--- a/linux/powerpc/ioctls_arch0.h
+++ b/linux/powerpc/ioctls_arch0.h
@@ -130,6 +130,7 @@
 { "linux/kvm.h", "KVM_NMI", _IOC_NONE, 0xae9a, 0x00 },
 { "linux/kvm.h", "KVM_PPC_ALLOCATE_HTAB", _IOC_READ|_IOC_WRITE, 0xaea7, 0x04 },
 { "linux/kvm.h", "KVM_PPC_CONFIGURE_V3_MMU", _IOC_WRITE, 0xaeaf, 0x10 },
+{ "linux/kvm.h", "KVM_PPC_GET_CPU_CHAR", _IOC_READ, 0xaeb1, 0x20 },
 { "linux/kvm.h", "KVM_PPC_GET_HTAB_FD", _IOC_WRITE, 0xaeaa, 0x20 },
 { "linux/kvm.h", "KVM_PPC_GET_PVINFO", _IOC_WRITE, 0xaea1, 0x80 },
 { "linux/kvm.h", "KVM_PPC_GET_RMMU_INFO", _IOC_WRITE, 0xaeb0, 0x60 },
diff --git a/linux/powerpc/set_error.c b/linux/powerpc/set_error.c
index 7edabee..38ae32b 100644
--- a/linux/powerpc/set_error.c
+++ b/linux/powerpc/set_error.c
@@ -3,7 +3,7 @@
 {
 	ppc_regs.gpr[3] = tcp->u_error;
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
+	return upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
 #else
 	return set_regs(tcp->pid);
 #endif
@@ -15,8 +15,8 @@
 	ppc_regs.gpr[3] = tcp->u_rval;
 	ppc_regs.ccr &= ~0x10000000;
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, sizeof(long) * PT_CCR, ppc_regs.ccr) ||
-	       upoke(tcp->pid, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
+	return upoke(tcp, sizeof(long) * PT_CCR, ppc_regs.ccr) ||
+	       upoke(tcp, sizeof(long) * (PT_R0 + 3), ppc_regs.gpr[3]);
 #else
 	return set_regs(tcp->pid);
 #endif
diff --git a/linux/powerpc/set_scno.c b/linux/powerpc/set_scno.c
index c5a0468..b2f6693 100644
--- a/linux/powerpc/set_scno.c
+++ b/linux/powerpc/set_scno.c
@@ -2,7 +2,7 @@
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
 #ifdef HAVE_GETREGS_OLD
-	return upoke(tcp->pid, sizeof(long) * PT_R0, scno);
+	return upoke(tcp, sizeof(long) * PT_R0, scno);
 #else
 	ppc_regs.gpr[0] = scno;
 	return set_regs(tcp->pid);
diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h
index d5e574a..d0bcbba 100644
--- a/linux/powerpc/syscallent.h
+++ b/linux/powerpc/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -234,7 +234,7 @@
 [204] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [205] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [206] = { 3,	TM,		SEN(mincore),			"mincore"		},
-[207] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[207] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [210] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -289,12 +289,12 @@
 [259] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [260] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [261] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[262] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[262] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [263] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[264] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[265] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[266] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[267] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[264] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[265] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[266] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[267] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [268] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [269] = { 5,	0,		SEN(add_key),			"add_key"		},
 [270] = { 4,	0,		SEN(request_key),		"request_key"		},
@@ -411,6 +411,9 @@
 [381] = { 6,	TD,		SEN(pwritev2),			"pwritev2"		},
 [382] = { 5,	TD,		SEN(kexec_file_load),		"kexec_file_load"	},
 [383] = { 5,	TD|TF|TSTA,	SEN(statx),			"statx"			},
+[384] = { 2,	0,		SEN(pkey_alloc),		"pkey_alloc"		},
+[385] = { 1,	0,		SEN(pkey_free),			"pkey_free"		},
+[386] = { 4,	TM|SI,		SEN(pkey_mprotect),		"pkey_mprotect"		},
 
 #define SYS_socket_subcall	400
 #include "subcall.h"
diff --git a/linux/powerpc64/arch_defs_.h b/linux/powerpc64/arch_defs_.h
new file mode 100644
index 0000000..037b52f
--- /dev/null
+++ b/linux/powerpc64/arch_defs_.h
@@ -0,0 +1,3 @@
+#define HAVE_ARCH_OLD_SELECT 1
+#define SUPPORTED_PERSONALITIES 2
+#define HAVE_ARCH_DEDICATED_ERR_REG 1
diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h
index 21ba1d8..74362c6 100644
--- a/linux/powerpc64/syscallent.h
+++ b/linux/powerpc64/syscallent.h
@@ -1,7 +1,7 @@
 /*
  * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
  * Copyright (c) 1993, 1994, 1995 Rick Sladkey <jrs@world.std.com>
- * Copyright (c) 1995-2017 The strace developers.
+ * Copyright (c) 1995-2018 The strace developers.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -47,11 +47,11 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF|TST|TSTA,	SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -74,10 +74,10 @@
 [ 44] = { 0,	0,		SEN(prof),			"prof"			},
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { 0,	0,		SEN(lock),			"lock"			},
@@ -91,8 +91,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
+[ 64] = { 0,	PU|NF,		SEN(getppid),			"getppid"		},
+[ 65] = { 0,	PU|NF,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [ 68] = { 0,	TS,		SEN(sgetmask),			"sgetmask"		},
@@ -229,7 +229,7 @@
 [204] = { },
 [205] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [206] = { 3,	TM,		SEN(mincore),			"mincore"		},
-[207] = { 0,	NF,		SEN(gettid),			"gettid"		},
+[207] = { 0,	PU|NF,		SEN(gettid),			"gettid"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [210] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
@@ -284,12 +284,12 @@
 [259] = { 6,	TM,		SEN(mbind),			"mbind"			},
 [260] = { 5,	TM,		SEN(get_mempolicy),		"get_mempolicy"		},
 [261] = { 3,	TM,		SEN(set_mempolicy),		"set_mempolicy"		},
-[262] = { 4,	0,		SEN(mq_open),			"mq_open"		},
+[262] = { 4,	TD,		SEN(mq_open),			"mq_open"		},
 [263] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
-[264] = { 5,	0,		SEN(mq_timedsend),		"mq_timedsend"		},
-[265] = { 5,	0,		SEN(mq_timedreceive),		"mq_timedreceive"	},
-[266] = { 2,	0,		SEN(mq_notify),			"mq_notify"		},
-[267] = { 3,	0,		SEN(mq_getsetattr),		"mq_getsetattr"		},
+[264] = { 5,	TD,		SEN(mq_timedsend),		"mq_timedsend"		},
+[265] = { 5,	TD,		SEN(mq_timedreceive),		"mq_timedreceive"	},
+[266] = { 2,	TD,		SEN(mq_notify),			"mq_notify"		},
+[267] = { 3,	TD,		SEN(mq_getsetattr),		"mq_getsetattr"		},
 [268] = { 4,	0,		SEN(kexec_load),		"kexec_load"		},
 [269] = { 5,	0,		SEN(add_key),			"add_key"		},
 [270] = { 4,	0,		SEN(request_key),		"request_key"		},
@@ -406,6 +406,9 @@
 [381] = { 6,	TD,		SEN(pwritev2),			"pwritev2"		},
 [382] = { 5,	TD,		SEN(kexec_file_load),		"kexec_file_load"	},
 [383] = { 5,	TD|TF|TSTA,	SEN(statx),			"statx"			},
+[384] = { 2,	0,		SEN(pkey_alloc),		"pkey_alloc"		},
+[385] = { 1,	0,		SEN(pkey_free),			"pkey_free"		},
+[386] = { 4,	TM|SI,		SEN(pkey_mprotect),		"pkey_mprotect"		},
 
 #define SYS_socket_subcall	400
 #include "subcall.h"
diff --git a/linux/ptp_clock.h b/linux/ptp_clock.h
deleted file mode 100644
index 248f3ce..0000000
--- a/linux/ptp_clock.h
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * PTP 1588 clock support - user space interface
- *
- * Copyright (c) 2010 OMICRON electronics GmbH
- * Copyright (c) 2010-2017 The strace developers.
- *
- *  This program is free software; you can redistribute it and/or modify
- *  it under the terms of the GNU General Public License as published by
- *  the Free Software Foundation; either version 2 of the License, or
- *  (at your option) any later version.
- *
- *  This program is distributed in the hope that it will be useful,
- *  but WITHOUT ANY WARRANTY; without even the implied warranty of
- *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- *  GNU General Public License for more details.
- *
- *  You should have received a copy of the GNU General Public License
- *  along with this program; if not, write to the Free Software
- *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- */
-
-#ifndef _PTP_CLOCK_H_
-#define _PTP_CLOCK_H_
-
-#include <linux/ioctl.h>
-#include <linux/types.h>
-
-/* PTP_xxx bits, for the flags field within the request structures. */
-#define PTP_ENABLE_FEATURE (1<<0)
-#define PTP_RISING_EDGE    (1<<1)
-#define PTP_FALLING_EDGE   (1<<2)
-
-/*
- * struct ptp_clock_time - represents a time value
- *
- * The sign of the seconds field applies to the whole value. The
- * nanoseconds field is always unsigned. The reserved field is
- * included for sub-nanosecond resolution, should the demand for
- * this ever appear.
- *
- */
-struct ptp_clock_time {
-	__s64 sec;  /* seconds */
-	__u32 nsec; /* nanoseconds */
-	__u32 reserved;
-};
-
-struct ptp_clock_caps {
-	int max_adj;   /* Maximum frequency adjustment in parts per billon. */
-	int n_alarm;   /* Number of programmable alarms. */
-	int n_ext_ts;  /* Number of external time stamp channels. */
-	int n_per_out; /* Number of programmable periodic signals. */
-	int pps;       /* Whether the clock supports a PPS callback. */
-	int rsv[15];   /* Reserved for future use. */
-};
-
-struct ptp_extts_request {
-	unsigned int index;  /* Which channel to configure. */
-	unsigned int flags;  /* Bit field for PTP_xxx flags. */
-	unsigned int rsv[2]; /* Reserved for future use. */
-};
-
-struct ptp_perout_request {
-	struct ptp_clock_time start;  /* Absolute start time. */
-	struct ptp_clock_time period; /* Desired period, zero means disable. */
-	unsigned int index;           /* Which channel to configure. */
-	unsigned int flags;           /* Reserved for future use. */
-	unsigned int rsv[4];          /* Reserved for future use. */
-};
-
-#define PTP_MAX_SAMPLES 25 /* Maximum allowed offset measurement samples. */
-
-struct ptp_sys_offset {
-	unsigned int n_samples; /* Desired number of measurements. */
-	unsigned int rsv[3];    /* Reserved for future use. */
-	/*
-	 * Array of interleaved system/phc time stamps. The kernel
-	 * will provide 2*n_samples + 1 time stamps, with the last
-	 * one as a system time stamp.
-	 */
-	struct ptp_clock_time ts[2 * PTP_MAX_SAMPLES + 1];
-};
-
-#define PTP_CLK_MAGIC '='
-
-#define PTP_CLOCK_GETCAPS  _IOR(PTP_CLK_MAGIC, 1, struct ptp_clock_caps)
-#define PTP_EXTTS_REQUEST  _IOW(PTP_CLK_MAGIC, 2, struct ptp_extts_request)
-#define PTP_PEROUT_REQUEST _IOW(PTP_CLK_MAGIC, 3, struct ptp_perout_request)
-#define PTP_ENABLE_PPS     _IOW(PTP_CLK_MAGIC, 4, int)
-#define PTP_SYS_OFFSET     _IOW(PTP_CLK_MAGIC, 5, struct ptp_sys_offset)
-
-struct ptp_extts_event {
-	struct ptp_clock_time t; /* Time event occurred. */
-	unsigned int index;      /* Which channel produced the event. */
-	unsigned int flags;      /* Reserved for future use. */
-	unsigned int rsv[2];     /* Reserved for future use. */
-};
-
-#endif
diff --git a/linux/riscv/arch_defs_.h b/linux/riscv/arch_defs_.h
new file mode 100644
index 0000000..33494f5
--- /dev/null
+++ b/linux/riscv/arch_defs_.h
@@ -0,0 +1,2 @@
+#define HAVE_ARCH_UID16_SYSCALLS 1
+#define SUPPORTED_PERSONALITIES 2
diff --git a/linux/riscv/syscallent.h b/linux/riscv/syscallent.h
index 7c416ef..3dfed89 100644
--- a/linux/riscv/syscallent.h
+++ b/linux/riscv/syscallent.h
@@ -1 +1,4 @@
 #include "64/syscallent.h"
+
+/* #define __NR_riscv_flush_icache (__NR_arch_specific_syscall + 15) */
+[259] = { 3,	TM,		SEN(riscv_flush_icache),	"riscv_flush_icache"	},
diff --git a/linux/s390/arch_defs_.h b/linux/s390/arch_defs_.h
new file mode 100644
index 0000000..59fee83
--- /dev/null
+++ b/linux/s390/arch_defs_.h
@@ -0,0 +1,3 @@
+#define HAVE_ARCH_OLD_MMAP 1
+#define HAVE_ARCH_OLD_MMAP_PGOFF 1
+#define HAVE_ARCH_UID16_SYSCALLS 1
diff --git a/linux/s390/arch_sigreturn.c b/linux/s390/arch_sigreturn.c
index d1b8598..9c9e0dd 100644
--- a/linux/s390/arch_sigreturn.c
+++ b/linux/s390/arch_sigreturn.c
@@ -1,11 +1,21 @@
+#ifndef S390_FRAME_PTR
+# define S390_FRAME_PTR s390_frame_ptr
+#endif
+#ifndef SIGNAL_FRAMESIZE
+# define SIGNAL_FRAMESIZE __SIGNAL_FRAMESIZE
+#endif
+#ifndef PTR_TYPE
+# define PTR_TYPE unsigned long
+#endif
+
 static void
 arch_sigreturn(struct tcb *tcp)
 {
-	unsigned long mask[NSIG_BYTES / sizeof(long)];
-	const unsigned long addr = *s390_frame_ptr + __SIGNAL_FRAMESIZE;
+	PTR_TYPE mask[NSIG_BYTES / sizeof(PTR_TYPE)];
+	const PTR_TYPE addr = *S390_FRAME_PTR + SIGNAL_FRAMESIZE;
 
 	if (umove(tcp, addr, &mask) < 0) {
-		tprintf("{mask=%#lx}", addr);
+		tprintf("{mask=%#llx}", zero_extend_signed_to_ull(addr));
 	} else {
 		tprintsigmask_addr("{mask=", mask);
 		tprints("}");
diff --git a/linux/s390/get_error.c b/linux/s390/get_error.c
index 6d4d0a5..6f3925b 100644
--- a/linux/s390/get_error.c
+++ b/linux/s390/get_error.c
@@ -1,12 +1,16 @@
 #include "negated_errno.h"
 
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && is_negated_errno(s390_regset.gprs[2])) {
+	if (check_errno && is_negated_errno(ARCH_REGSET.gprs[2])) {
 		tcp->u_rval = -1;
-		tcp->u_error = -s390_regset.gprs[2];
+		tcp->u_error = -ARCH_REGSET.gprs[2];
 	} else {
-		tcp->u_rval = s390_regset.gprs[2];
+		tcp->u_rval = ARCH_REGSET.gprs[2];
 	}
 }
diff --git a/linux/s390/get_scno.c b/linux/s390/get_scno.c
index d323860..2661795 100644
--- a/linux/s390/get_scno.c
+++ b/linux/s390/get_scno.c
@@ -1,8 +1,12 @@
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
 /* Return codes: 1 - ok, 0 - ignore, other - error. */
 static int
 arch_get_scno(struct tcb *tcp)
 {
-	tcp->scno = s390_regset.gprs[2] ?
-		    s390_regset.gprs[2] : s390_regset.gprs[1];
+	tcp->scno = ARCH_REGSET.gprs[2] ?
+		    ARCH_REGSET.gprs[2] : ARCH_REGSET.gprs[1];
 	return 1;
 }
diff --git a/linux/s390/get_syscall_args.c b/linux/s390/get_syscall_args.c
index ebf6c6c..2c35380 100644
--- a/linux/s390/get_syscall_args.c
+++ b/linux/s390/get_syscall_args.c
@@ -1,12 +1,16 @@
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
 /* Return -1 on error or 1 on success (never 0!). */
 static int
 get_syscall_args(struct tcb *tcp)
 {
-	tcp->u_arg[0] = s390_regset.orig_gpr2;
-	tcp->u_arg[1] = s390_regset.gprs[3];
-	tcp->u_arg[2] = s390_regset.gprs[4];
-	tcp->u_arg[3] = s390_regset.gprs[5];
-	tcp->u_arg[4] = s390_regset.gprs[6];
-	tcp->u_arg[5] = s390_regset.gprs[7];
+	tcp->u_arg[0] = ARCH_REGSET.orig_gpr2;
+	tcp->u_arg[1] = ARCH_REGSET.gprs[3];
+	tcp->u_arg[2] = ARCH_REGSET.gprs[4];
+	tcp->u_arg[3] = ARCH_REGSET.gprs[5];
+	tcp->u_arg[4] = ARCH_REGSET.gprs[6];
+	tcp->u_arg[5] = ARCH_REGSET.gprs[7];
 	return 1;
 }
diff --git a/linux/s390/set_error.c b/linux/s390/set_error.c
index 7262e5c..f73e578 100644
--- a/linux/s390/set_error.c
+++ b/linux/s390/set_error.c
@@ -1,13 +1,17 @@
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
 static int
 arch_set_error(struct tcb *tcp)
 {
-	s390_regset.gprs[2] = -tcp->u_error;
+	ARCH_REGSET.gprs[2] = -tcp->u_error;
 	return set_regs(tcp->pid);
 }
 
 static int
 arch_set_success(struct tcb *tcp)
 {
-	s390_regset.gprs[2] = tcp->u_rval;
+	ARCH_REGSET.gprs[2] = tcp->u_rval;
 	return set_regs(tcp->pid);
 }
diff --git a/linux/s390/set_scno.c b/linux/s390/set_scno.c
index c7a3110..6bb9999 100644
--- a/linux/s390/set_scno.c
+++ b/linux/s390/set_scno.c
@@ -1,6 +1,10 @@
+#ifndef ARCH_REGSET
+# define ARCH_REGSET s390_regset
+#endif
+
 static int
 arch_set_scno(struct tcb *tcp, kernel_ulong_t scno)
 {
-	s390_regset.gprs[2] = scno;
+	ARCH_REGSET.gprs[2] = scno;
 	return set_regs(tcp->pid);
 }
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index 2bf5a21..b7e768e 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -1,6 +1,6 @@
 /*
  * Copyright (c) 2000 IBM Deutschland Entwicklung GmbH, IBM Coporation
- * Copyright (c) 2000-2017 The strace developers.
+ * Copyright (c) 2000-2018 The strace developers.
  * Authors: Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
  *          D.J. Barrow  <barrow_dj@mail.yahoo.com,djbarrow@de.ibm.com>
  * All rights reserved.
@@ -49,11 +49,11 @@
 [ 17] = { },
 [ 18] = { },
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	PU|NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
-[ 24] = { 0,	NF,		SEN(getuid16),			"getuid"		},
+[ 24] = { 0,	PU|NF,		SEN(getuid16),			"getuid"		},
 [ 25] = { 1,	0,		SEN(stime),			"stime"			},
 [ 26] = { 4,	0,		SEN(ptrace),			"ptrace"		},
 [ 27] = { 1,	0,		SEN(alarm),			"alarm"			},
@@ -76,10 +76,10 @@
 [ 44] = { },
 [ 45] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 46] = { 1,	0,		SEN(setgid16),			"setgid"		},
-[ 47] = { 0,	NF,		SEN(getgid16),			"getgid"		},
+[ 47] = { 0,	PU|NF,		SEN(getgid16),			"getgid"		},
 [ 48] = { 2,	TS,		SEN(signal),			"signal"		},
-[ 49] = { 0,	NF,		SEN(geteuid16),			"geteuid"		},
-[ 50] = { 0,	NF,		SEN(getegid16),			"getegid"		},
+[ 49] = { 0,	PU|NF,		SEN(geteuid16),			"geteuid"		},
+[ 50] = { 0,	PU|NF,		SEN(getegid16),			"getegid"		},
 [ 51] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 52] = { 2,	TF,		SEN(umount2),			"umount2"		},
 [ 53] = { },
@@ -93,8 +93,8 @@
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TSFA,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
-[