Merge remote-tracking branch 'strace/master' into HEAD
diff --git a/.mailmap b/.mailmap
index c068e74..a04a2f8 100644
--- a/.mailmap
+++ b/.mailmap
@@ -1,6 +1,7 @@
 # Map git author names and email addresses to canonical/preferred form.
 <ak@linux.intel.com>	<ak@suse.de>
 <holger@freyther.de>	<zecke@selfish.org>
+<kirill@shutemov.name>	<kirill.shutemov@linux.intel.com>
 <schwab@linux-m68k.org>	<schwab@redhat.com>
 <schwab@linux-m68k.org>	<schwab@suse.de>
 <vda.linux@googlemail.com>	<dvlasenk@redhat.com>
diff --git a/.travis.yml b/.travis.yml
index a98f720..b1aba3b 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -10,7 +10,6 @@
   apt:
     packages:
     - gcc-multilib
-    - libacl1-dev
 
 env:
   global:
diff --git a/Makefile.am b/Makefile.am
index 89cf2df..d43608d 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,4 +1,32 @@
 # Automake input for strace.
+#
+# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
+# Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# 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.
 
 if HAVE_M32_RUNTIME
 TESTS_M32 = tests-m32
@@ -47,6 +75,7 @@
 	chmod.c		\
 	clone.c		\
 	count.c		\
+	defs.h		\
 	desc.c		\
 	dirent.c	\
 	dirent64.c	\
@@ -68,6 +97,7 @@
 	flock.c		\
 	flock.h		\
 	futex.c		\
+	gcc_compat.h	\
 	get_robust_list.c \
 	getcpu.c	\
 	getcwd.c	\
@@ -183,7 +213,6 @@
 strace_LDADD += $(libunwind_LIBS)
 endif
 
-noinst_HEADERS = defs.h
 # Enable this to get link map generated
 #strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile
 
diff --git a/NEWS b/NEWS
index 034bf1a..f66d321 100644
--- a/NEWS
+++ b/NEWS
@@ -1,6 +1,92 @@
 Noteworthy changes in release ?.?? (????-??-??)
 ===============================================
 
+* Improvements
+  * Enhanced decoding of personality syscall.
+
+* Bug fixes
+  * Fixed build on arc, metag, nios2, or1k, and tile architectures.
+
+Noteworthy changes in release 4.11 (2015-12-21)
+===============================================
+
+* Changes in behavior
+  * Some syscalls have different names depending on architecture and
+    personality.  In these cases, syscall filtering and printing now
+    consistently uses the names that match corresponding __NR_* kernel
+    macros of the tracee's architecture and personality.
+  * Added strace prefix to all diagnostic messages.
+
+* Improvements
+  * Enhanced and extended test suite.
+  * Implemented reliable tracing of processes whose personality differs
+    from the personality of strace, fixed decoding of 32-bit personality
+    syscalls on 64-bit architectures.
+  * When some data referenced by syscall arguments is irrelevant or cannot
+    be read from tracee's memory, strace now prints its address consistently.
+  * When a syscall is restarted using restart_syscall mechanism, strace now
+    shows the syscall name on architectures that expose this information.
+  * Print values returned by epoll_create1, eventfd, eventfd2, fanotify_init,
+    inotify_init1, perf_event_open, pipe, pipe2, signalfd, signalfd4, socket,
+    socketpair, timerfd, and timerfd_create syscalls, as well as F_DUPFD and
+    F_DUPFD_CLOEXEC fcntl commands, as file descriptors.
+  * Optimized decoding of indirect socket syscalls.
+  * Implemented decoding of nanoseconds along with seconds in stat family
+    syscalls (addresses Fedora bug #1251176).
+  * Implemented decoding of struct statfs.f_flags in statfs syscall.
+  * Implemented decoding of siginfo_t.si_syscall and siginfo_t.si_arch
+    in SIGSYS signal.
+  * Implemented decoding of indirect syscall on mips o32.
+  * Implemented decoding of IPPROTO_IP control messages.
+  * Implemented decoding of setsockopt syscall multicast arguments.
+  * Enhanced decoding of struct sigevent.
+  * Enhanced decoding of block, loop, mtd, ptp, rtc, SG_IO, socket, tty,
+    and v4l2 ioctl syscall arguments.
+  * Enhanced decoding of epoll_create, fcntl, fcntl64, futex, getdents,
+    getdents64, getsockopt, io_*, mount, msgctl, prctl, quotactl, recvfrom,
+    sendfile, setsockopt, and shmctl syscalls.
+  * Implemented decoding of bpf, execveat, ioperm, iopl, kcmp, kexec_file_load,
+    lookup_dcookie, membarrier, memfd_create, mlock2, name_to_handle_at,
+    open_by_handle_at, sched_getattr, sched_setattr, and userfaultfd syscalls.
+  * Updated lists of AF_*, EPOLL_*, FALLOC_FL_*, F_*, INPUT_PROP_*, IPPROTO_*,
+    IPV6_*, IP_*, KEY_*, LOCK_*, MNT_*, MS_*, PACKET_*, PERF_FLAG_*, PF_*,
+    PR_*, PTRACE_O_*, RENAME_*, SCTP_*, SECBIT_*, SO_*, TCP_*, and siginfo_t
+    constants.
+  * Added Nios II architecture support.
+  * Added new syscall entries to match Linux 4.4.
+
+* Bug fixes
+  * Fixed potential short read of strings from tracee's memory.
+  * Fixed -qq option in conjunction with -o option.
+  * Fixed filtering of <unavailable> syscalls.
+  * Fixed decoding of ioctl syscall command on aarch64 and 32-bit architectures
+    with 64-bit aligned structures.
+  * Fixed decoding of eventfd2, epoll_create1, signalfd4, and sync_file_range2
+    syscall flags arguments.
+  * Fixed decoding of 4th argument of clock_nanosleep syscall.
+  * Fixed decoding of getpagesize syscall on m68k.
+  * Fixed decoding of getrandom and seccomp syscalls on aarch64.
+  * Fixed decoding of timezone argument of gettimeofday and settimeofday
+  * syscalls.
+  * Fixed decoding of offset argument of mmap2 syscall on arm, sparc,
+    and sparc64.
+  * Fixed decoding of pipe syscall on alpha and mips.
+  * Fixed decoding of pipe2 syscall on ia64, sh, sparc, and sparc64.
+  * Fixed decoding of signal mask argument of pselect6 syscall on x32.
+  * Fixed decoding of signal mask of rt_sigreturn syscall on aarch64, m68k,
+    and x32.
+  * Fixed decoding of 4th argument of semctl indirect syscall.
+  * Fixed decoding of sa_restorer and sa_mask of sigaction syscall on m68k.
+  * Fixed decoding of statfs64 and fstatfs64 syscalls on arm eabi.
+  * Fixed decoding of struct dirent on x32.
+  * Fixed decoding of times syscall return value on mips n32 and x32.
+  * Fixed decoding of path argument of umount2 syscall
+    (addresses Debian bug #785050).
+  * Worked around a kernel bug in tracing privileged executables.
+  * Fixed various errors in mapping between syscall numbers and associated
+    information like the number of syscall arguments, the name of syscall,
+    and syscall decoder.
+
 Noteworthy changes in release 4.10 (2015-03-06)
 ===============================================
 
diff --git a/affinity.c b/affinity.c
index 42cdd6c..55bc7e1 100644
--- a/affinity.c
+++ b/affinity.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2009-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 static void
diff --git a/cacheflush.c b/cacheflush.c
index e4b704c..aa8bc86 100644
--- a/cacheflush.c
+++ b/cacheflush.c
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 1999 Andreas Schwab <schwab@issan.cs.uni-dortmund.de>
+ * Copyright (c) 2010 Mike Frysinger <vapier@gentoo.org>
+ * Copyright (c) 2010 Carmelo Amoroso <carmelo.amoroso@st.com>
+ * Copyright (c) 2015 Ezequiel Garcia <ezequiel@vanguardiasur.com.ar>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef HAVE_ASM_CACHECTL_H
diff --git a/capability.c b/capability.c
index 6b698ac..421649d 100644
--- a/capability.c
+++ b/capability.c
@@ -1,3 +1,32 @@
+/*
+ * Copyright (c) 2000 Wichert Akkerman <wakkerma@debian.org>
+ * Copyright (c) 2011 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 /* these constants are the same as in <linux/capability.h> */
diff --git a/clone.c b/clone.c
index 63304c2..cf271da 100644
--- a/clone.c
+++ b/clone.c
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 1999-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * 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>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <sched.h>
diff --git a/configure.ac b/configure.ac
index db704cc..1524b9b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,4 +1,34 @@
-dnl Process this file with autoconf to create configure.  Use autoreconf.
+# Configure template for strace.
+#
+# Copyright (c) 1999-2001 Wichert Akkerman <wichert@deephackmode.org>
+# Copyright (c) 2002-2009 Roland McGrath <roland@redhat.com>
+# Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+# Copyright (c) 2008-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# 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.
+
 AC_PREREQ(2.57)
 AC_INIT([strace],
 	m4_esyscmd([./git-version-gen .tarball-version]),
@@ -247,7 +277,6 @@
 [#include <sys/types.h>
 #include <sys/socket.h>
 #include <netinet/in.h>])
-AC_LITTLE_ENDIAN_LONG_LONG
 
 AC_CHECK_FUNCS(m4_normalize([
 	fanotify_mark
diff --git a/debian/changelog b/debian/changelog
index 74392ed..e8b3e3b 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,35 @@
-strace (4.10-1) experimental; urgency=low
+strace (4.11-1) unstable; urgency=low
 
+  [ Dmitry V. Levin ]
+  * New upstream version.
+    + fixed decoding of path argument of umount2 syscall, closes: #785050
+
+ -- Dmitry V. Levin <ldv@altlinux.org>  Mon, 21 Dec 2015 20:21:22 +0000
+
+strace (4.10-3) unstable; urgency=medium
+
+  * Really fix mips* builds - fix sys_syscall() handling.
+    Closes: #781753
+  * Clean up strace64.substvars at clean time
+  * Remove ancient changelog entries that annoy lintian
+  * Update Standards-Version to 3.9.6 (no changes needed)
+
+ -- Steve McIntyre <93sam@debian.org>  Wed, 08 Jul 2015 23:44:03 +0100
+
+strace (4.10-2) unstable; urgency=medium
+
+  * Fix building on arm64 using patches from upstream. Closes: #790770
+  * Fix various test suite failures using patches from upstream.
+    Closes: #781040
+  * Fix mips o32 build. Thanks to Arturo Borrero Gonzalez
+    <arturo.borrero.glez@gmail.com> for tracking this.
+  * Add build-dependency on gawk for the test suite. Closes: #780992
+
+ -- Steve McIntyre <93sam@debian.org>  Thu, 02 Jul 2015 02:03:25 +0100
+
+strace (4.10-1) unstable; urgency=low
+
+  [ Dmitry V. Levin ]
   * New upstream version.
     + enhanced ioctl decoding,  closes: #692913
     + enabled mips64el build, closes: #773375
@@ -7,7 +37,7 @@
     + updated generic and added arch-specific PTRACE_* constants,
       closes: #734554
 
- -- Dmitry V. Levin <ldv@altlinux.org>  Fri, 06 Mar 2015 13:14:15 +0000
+ -- Steve McIntyre <93sam@debian.org>  Sat, 21 Mar 2015 22:18:25 +0000
 
 strace (4.9-2) unstable; urgency=medium
 
@@ -767,7 +797,7 @@
   * Ported to libc6 / glibc2 (Bug# 11729)
   * Compress manpage
 
- -- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>  Fri,  1 Aug 1997 00:13:38 +02
+ -- Wichert Akkerman <wakkerma@wi.leidenuniv.nl>  Fri,  1 Aug 1997 00:13:38 +0200
 
 strace (3.1-10) unstable; urgency=low
 
diff --git a/debian/control b/debian/control
index 5c67fea..c762be1 100644
--- a/debian/control
+++ b/debian/control
@@ -2,8 +2,8 @@
 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 [i386 powerpc s390 sparc], debhelper (>= 7.0.0), gawk
-Standards-Version: 3.9.5
+Build-Depends: libc6-dev (>= 2.2.2) [!alpha !ia64], libc6.1-dev (>= 2.2.2) [alpha ia64], gcc-multilib [i386 powerpc s390 sparc], debhelper (>= 7.0.0), gawk, libunwind-dev [amd64]
+Standards-Version: 3.9.6
 Homepage: http://sourceforge.net/projects/strace/
 
 Package: strace
diff --git a/debian/rules b/debian/rules
index 912b410..a9ba147 100755
--- a/debian/rules
+++ b/debian/rules
@@ -62,7 +62,7 @@
 clean:
 	dh_testdir
 	dh_testroot
-	rm -rf build build64 strace64.1
+	rm -rf build build64 strace64.1 debian/strace64.substvars
 	dh_clean
 
 binary: binary-indep binary-arch
diff --git a/defs.h b/defs.h
index 0538bcf..bae212c 100644
--- a/defs.h
+++ b/defs.h
@@ -55,6 +55,7 @@
 #include <sys/syscall.h>
 
 #include "mpers_type.h"
+#include "gcc_compat.h"
 
 #ifndef HAVE_STRERROR
 const char *strerror(int);
@@ -68,48 +69,6 @@
 extern char *stpcpy(char *dst, const char *src);
 #endif
 
-#if defined __GNUC__ && defined __GNUC_MINOR__
-# define GNUC_PREREQ(maj, min)	\
-	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
-#else
-# define __attribute__(x)	/* empty */
-# define GNUC_PREREQ(maj, min)	0
-#endif
-
-#if GNUC_PREREQ(2, 5)
-# define ATTRIBUTE_NORETURN	__attribute__((__noreturn__))
-#else
-# define ATTRIBUTE_NORETURN	/* empty */
-#endif
-
-#if GNUC_PREREQ(2, 7)
-# define ATTRIBUTE_FORMAT(args)	__attribute__((__format__ args))
-# define ATTRIBUTE_ALIGNED(arg)	__attribute__((__aligned__(arg)))
-# define ATTRIBUTE_PACKED	__attribute__((__packed__))
-#else
-# define ATTRIBUTE_FORMAT(args)	/* empty */
-# define ATTRIBUTE_ALIGNED(arg)	/* empty */
-# define ATTRIBUTE_PACKED	/* empty */
-#endif
-
-#if GNUC_PREREQ(3, 0)
-# define ATTRIBUTE_MALLOC	__attribute__((__malloc__))
-#else
-# define ATTRIBUTE_MALLOC	/* empty */
-#endif
-
-#if GNUC_PREREQ(3, 1)
-# define ATTRIBUTE_NOINLINE	__attribute__((__noinline__))
-#else
-# define ATTRIBUTE_NOINLINE	/* empty */
-#endif
-
-#if GNUC_PREREQ(4, 3)
-# define ATTRIBUTE_ALLOC_SIZE(args)	__attribute__((__alloc_size__ args))
-#else
-# define ATTRIBUTE_ALLOC_SIZE(args)	/* empty */
-#endif
-
 #ifndef offsetof
 # define offsetof(type, member)	\
 	(((char *) &(((type *) NULL)->member)) - ((char *) (type *) NULL))
@@ -582,12 +541,12 @@
 /* a refers to the lower numbered u_arg,
  * b refers to the higher numbered u_arg
  */
-#ifdef HAVE_LITTLE_ENDIAN_LONG_LONG
-# define LONG_LONG(a,b) \
-	((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
-#else
+#ifdef WORDS_BIGENDIAN
 # define LONG_LONG(a,b) \
 	((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32)))
+#else
+# define LONG_LONG(a,b) \
+	((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32)))
 #endif
 extern int getllval(struct tcb *, unsigned long long *, int);
 extern int printllval(struct tcb *, const char *, int)
@@ -800,8 +759,8 @@
 #define MPERS_FUNC_NAME_(prefix, name) MPERS_FUNC_NAME__(prefix, name)
 #define MPERS_FUNC_NAME(name) MPERS_FUNC_NAME_(MPERS_PREFIX, name)
 
-#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(sys_ ## syscall_name)
+#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name)
 
-#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(syscall_name)(struct tcb *tcp)
+#define SYS_FUNC(syscall_name) int SYS_FUNC_NAME(sys_ ## syscall_name)(struct tcb *tcp)
 
 #define MPERS_PRINTER_DECL(type, name) type MPERS_FUNC_NAME(name)
diff --git a/desc.c b/desc.c
index ff2ed17..a233900 100644
--- a/desc.c
+++ b/desc.c
@@ -270,7 +270,7 @@
 			/* NB: kernel requires data[1] == NSIG / 8 */
 			print_sigset_addr_len(tcp, (unsigned long) data[0],
 					      (unsigned long) data[1]);
-			tprintf(", %Lu}", (unsigned long long) data[1]);
+			tprintf(", %llu}", (unsigned long long) data[1]);
 		}
 	}
 
diff --git a/dirent.c b/dirent.c
index bad9bcd..ae576c8 100644
--- a/dirent.c
+++ b/dirent.c
@@ -47,7 +47,7 @@
 	if (umove_or_printaddr(tcp, addr, &d))
 		return;
 
-	tprintf("{d_ino=%Lu, d_off=%Lu, d_reclen=%u, d_name=",
+	tprintf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=",
 		(unsigned long long) d.d_ino,
 		(unsigned long long) d.d_off, d.d_reclen);
 	if (d.d_reclen > D_NAME_LEN_MAX)
@@ -122,7 +122,7 @@
 			if (d_name_len > D_NAME_LEN_MAX)
 				d_name_len = D_NAME_LEN_MAX;
 
-			tprintf("%s{d_ino=%Lu, d_off=%Lu, d_reclen=%u"
+			tprintf("%s{d_ino=%llu, d_off=%llu, d_reclen=%u"
 				", d_name=", i ? ", " : "",
 				(unsigned long long) d->d_ino,
 				(unsigned long long) d->d_off, d->d_reclen);
diff --git a/epoll.c b/epoll.c
index 740cca5..eed4447 100644
--- a/epoll.c
+++ b/epoll.c
@@ -1,3 +1,32 @@
+/*
+ * Copyright (c) 2004-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <fcntl.h>
 #ifdef HAVE_SYS_EPOLL_H
diff --git a/eventfd.c b/eventfd.c
index 0f89946..0e7babc 100644
--- a/eventfd.c
+++ b/eventfd.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <fcntl.h>
 #ifdef HAVE_SYS_EVENTFD_H
diff --git a/execve.c b/execve.c
index a8f53f6..b1d9c56 100644
--- a/execve.c
+++ b/execve.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2011-2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2010-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 static void
diff --git a/fadvise.c b/fadvise.c
index 06df82d..2001394 100644
--- a/fadvise.c
+++ b/fadvise.c
@@ -1,3 +1,35 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007 Daniel Jacobowitz  <dan@codesourcery.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2009 Kirill A. Shutemov <kirill@shutemov.name>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
diff --git a/fanotify.c b/fanotify.c
index 74b1d92..715ea63 100644
--- a/fanotify.c
+++ b/fanotify.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include "xlat/fan_classes.h"
diff --git a/fcntl.c b/fcntl.c
index 88809fe..561c164 100644
--- a/fcntl.c
+++ b/fcntl.c
@@ -46,7 +46,7 @@
 	printxval(lockfcmds, fl->l_type, "F_???");
 	tprints(", l_whence=");
 	printxval(whence_codes, fl->l_whence, "SEEK_???");
-	tprintf(", l_start=%Ld, l_len=%Ld",
+	tprintf(", l_start=%lld, l_len=%lld",
 		(long long) fl->l_start, (long long) fl->l_len);
 	if (getlk)
 		tprintf(", l_pid=%lu", (unsigned long) fl->l_pid);
diff --git a/fetch_seccomp_fprog.c b/fetch_seccomp_fprog.c
index e32366a..dbaf83a 100644
--- a/fetch_seccomp_fprog.c
+++ b/fetch_seccomp_fprog.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include DEF_MPERS_TYPE(seccomp_fprog_t)
diff --git a/flock.h b/flock.h
index 33b7538..b1ab8ff 100644
--- a/flock.h
+++ b/flock.h
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <linux/fcntl.h>
 
 #if defined HAVE_STRUCT_FLOCK
diff --git a/futex.c b/futex.c
index f492186..7090c7d 100644
--- a/futex.c
+++ b/futex.c
@@ -1,3 +1,33 @@
+/*
+ * Copyright (c) 2002-2003 Roland McGrath  <roland@redhat.com>
+ * Copyright (c) 2007-2008 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef HAVE_LINUX_FUTEX_H
diff --git a/gcc_compat.h b/gcc_compat.h
new file mode 100644
index 0000000..1f2c835
--- /dev/null
+++ b/gcc_compat.h
@@ -0,0 +1,73 @@
+/*
+ * Copyright (c) 2015 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 GCC_COMPAT_H_
+#define GCC_COMPAT_H_
+
+#if defined __GNUC__ && defined __GNUC_MINOR__
+# define GNUC_PREREQ(maj, min)	\
+	((__GNUC__ << 16) + __GNUC_MINOR__ >= ((maj) << 16) + (min))
+#else
+# define __attribute__(x)	/* empty */
+# define GNUC_PREREQ(maj, min)	0
+#endif
+
+#if GNUC_PREREQ(2, 5)
+# define ATTRIBUTE_NORETURN	__attribute__((__noreturn__))
+#else
+# define ATTRIBUTE_NORETURN	/* empty */
+#endif
+
+#if GNUC_PREREQ(2, 7)
+# define ATTRIBUTE_FORMAT(args)	__attribute__((__format__ args))
+# define ATTRIBUTE_ALIGNED(arg)	__attribute__((__aligned__(arg)))
+# define ATTRIBUTE_PACKED	__attribute__((__packed__))
+#else
+# define ATTRIBUTE_FORMAT(args)	/* empty */
+# define ATTRIBUTE_ALIGNED(arg)	/* empty */
+# define ATTRIBUTE_PACKED	/* empty */
+#endif
+
+#if GNUC_PREREQ(3, 0)
+# define ATTRIBUTE_MALLOC	__attribute__((__malloc__))
+#else
+# define ATTRIBUTE_MALLOC	/* empty */
+#endif
+
+#if GNUC_PREREQ(3, 1)
+# define ATTRIBUTE_NOINLINE	__attribute__((__noinline__))
+#else
+# define ATTRIBUTE_NOINLINE	/* empty */
+#endif
+
+#if GNUC_PREREQ(4, 3)
+# define ATTRIBUTE_ALLOC_SIZE(args)	__attribute__((__alloc_size__ args))
+#else
+# define ATTRIBUTE_ALLOC_SIZE(args)	/* empty */
+#endif
+
+#endif
diff --git a/get_robust_list.c b/get_robust_list.c
index 23d978f..1977023 100644
--- a/get_robust_list.c
+++ b/get_robust_list.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 SYS_FUNC(get_robust_list)
diff --git a/inotify.c b/inotify.c
index 98d24f2..5ada8a8 100644
--- a/inotify.c
+++ b/inotify.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <fcntl.h>
 
diff --git a/ioprio.c b/ioprio.c
index bf54460..0a1a596 100644
--- a/ioprio.c
+++ b/ioprio.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 enum {
diff --git a/kcmp.c b/kcmp.c
index aba5a61..aec494a 100644
--- a/kcmp.c
+++ b/kcmp.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include "xlat/kcmp_types.h"
 
diff --git a/kernel_types.h b/kernel_types.h
index c8b6a04..3dee761 100644
--- a/kernel_types.h
+++ b/kernel_types.h
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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_KERNEL_TYPES_H
 
 # define STRACE_KERNEL_TYPES_H
diff --git a/kexec.c b/kexec.c
index a920b42..89b7528 100644
--- a/kexec.c
+++ b/kexec.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include "xlat/kexec_load_flags.h"
diff --git a/keyctl.c b/keyctl.c
index 0c4961f..81391a3 100644
--- a/keyctl.c
+++ b/keyctl.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 typedef int32_t key_serial_t;
diff --git a/ldt.c b/ldt.c
index 73a17e8..7d5c7bf 100644
--- a/ldt.c
+++ b/ldt.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * 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>
+ * 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"
 
 #if defined I386 || defined X86_64 || defined X32
diff --git a/link.c b/link.c
index 38b92d0..68a1304 100644
--- a/link.c
+++ b/link.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
diff --git a/linux/32/syscallent.h b/linux/32/syscallent.h
index 5f997e7..6aaa025 100644
--- a/linux/32/syscallent.h
+++ b/linux/32/syscallent.h
@@ -1,5 +1,5 @@
-#ifndef ARCH_mmap
-# define ARCH_mmap mmap
+#ifndef sys_ARCH_mmap
+# define sys_ARCH_mmap sys_mmap
 #endif
 [  0] = { 2,	0,		SEN(io_setup),			"io_setup"		},
 [  1] = { 1,	0,		SEN(io_destroy),		"io_destroy"		},
@@ -97,7 +97,7 @@
 [ 89] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 90] = { 2,	0,		SEN(capget),			"capget"		},
 [ 91] = { 2,	0,		SEN(capset),			"capset"		},
-[ 92] = { 1,	0,		SEN(personality),		"personality"		},
+[ 92] = { 1,	NF,		SEN(personality),		"personality"		},
 [ 93] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [ 94] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
 [ 95] = { 5,	TP,		SEN(waitid),			"waitid"		},
@@ -171,19 +171,19 @@
 [163] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [164] = { 2,	0,		SEN(setrlimit),			"setrlimit"		},
 [165] = { 2,	0,		SEN(getrusage),			"getrusage"		},
-[166] = { 1,	0,		SEN(umask),			"umask"			},
+[166] = { 1,	NF,		SEN(umask),			"umask"			},
 [167] = { 5,	0,		SEN(prctl),			"prctl"			},
 [168] = { 3,	0,		SEN(getcpu),			"getcpu"		},
 [169] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [170] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
 [171] = { 1,	0,		SEN(adjtimex),			"adjtimex"		},
-[172] = { 0,	0,		SEN(getpid),			"getpid"		},
-[173] = { 0,	0,		SEN(getppid),			"getppid"		},
+[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,	0,		SEN(gettid),			"gettid"		},
+[178] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [180] = { 4,	0,		SEN(mq_open),			"mq_open"		},
 [181] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
@@ -276,5 +276,5 @@
 [283] = { 2,	0,		SEN(membarrier),		"membarrier",		},
 [284] = { 3,	TM,		SEN(mlock2),			"mlock2"		},
 
-#undef ARCH_mmap
+#undef sys_ARCH_mmap
 #undef ARCH_WANT_SYNC_FILE_RANGE2
diff --git a/linux/64/syscallent.h b/linux/64/syscallent.h
index ec75d3c..64cc86f 100644
--- a/linux/64/syscallent.h
+++ b/linux/64/syscallent.h
@@ -90,7 +90,7 @@
 [ 89] = { 1,	TF,		SEN(acct),			"acct"			},
 [ 90] = { 2,	0,		SEN(capget),			"capget"		},
 [ 91] = { 2,	0,		SEN(capset),			"capset"		},
-[ 92] = { 1,	0,		SEN(personality),		"personality"		},
+[ 92] = { 1,	NF,		SEN(personality),		"personality"		},
 [ 93] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [ 94] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
 [ 95] = { 5,	TP,		SEN(waitid),			"waitid"		},
@@ -164,19 +164,19 @@
 [163] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [164] = { 2,	0,		SEN(setrlimit),			"setrlimit"		},
 [165] = { 2,	0,		SEN(getrusage),			"getrusage"		},
-[166] = { 1,	0,		SEN(umask),			"umask"			},
+[166] = { 1,	NF,		SEN(umask),			"umask"			},
 [167] = { 5,	0,		SEN(prctl),			"prctl"			},
 [168] = { 3,	0,		SEN(getcpu),			"getcpu"		},
 [169] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [170] = { 2,	0,		SEN(settimeofday),		"settimeofday"		},
 [171] = { 1,	0,		SEN(adjtimex),			"adjtimex"		},
-[172] = { 0,	0,		SEN(getpid),			"getpid"		},
-[173] = { 0,	0,		SEN(getppid),			"getppid"		},
+[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,	0,		SEN(gettid),			"gettid"		},
+[178] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [179] = { 1,	0,		SEN(sysinfo),			"sysinfo"		},
 [180] = { 4,	0,		SEN(mq_open),			"mq_open"		},
 [181] = { 1,	0,		SEN(mq_unlink),			"mq_unlink"		},
diff --git a/linux/aarch64/arch_regs.c b/linux/aarch64/arch_regs.c
index 78b7470..8e18a71 100644
--- a/linux/aarch64/arch_regs.c
+++ b/linux/aarch64/arch_regs.c
@@ -1,5 +1,5 @@
 struct arm_pt_regs {
-        int uregs[18];
+        uint32_t uregs[18];
 };
 #define ARM_cpsr       uregs[16]
 #define ARM_pc         uregs[15]
diff --git a/linux/alpha/get_error.c b/linux/alpha/get_error.c
index ddf3dae..d4928d4 100644
--- a/linux/alpha/get_error.c
+++ b/linux/alpha/get_error.c
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && alpha_a3) {
+	if (alpha_a3) {
 		tcp->u_rval = -1;
 		tcp->u_error = alpha_r0;
 	} else {
diff --git a/linux/alpha/syscallent.h b/linux/alpha/syscallent.h
index fd6e1da..026c1cf 100644
--- a/linux/alpha/syscallent.h
+++ b/linux/alpha/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 18] = { 5,	0,		SEN(printargs),			"osf_getfsstat"		}, /*not implemented */
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getxpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getxpid"		},
 [ 21] = { 4,	0,		SEN(printargs),			"osf_mount"		},
 [ 22] = { 2,	TF,		SEN(umount2),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -86,7 +86,7 @@
 [ 57] = { 2,	TF,		SEN(symlink),			"symlink"		},
 [ 58] = { 3,	TF,		SEN(readlink),			"readlink"		},
 [ 59] = { 3,	TF|TP|SE|SI,	SEN(execve),			"execve"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 5,	0,		SEN(printargs),			"osf_old_fstat"		}, /*not implemented */
 [ 63] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
@@ -287,7 +287,7 @@
 [321] = { 1,	TF,		SEN(umount),			"oldumount"		},
 [322] = { 2,	TF,		SEN(swapon),			"swapon"		},
 [323] = { 1,	0,		SEN(times),			"times"			},
-[324] = { 1,	0,		SEN(personality),		"personality"		},
+[324] = { 1,	NF,		SEN(personality),		"personality"		},
 [325] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [326] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
 [327] = { 2,	0,		SEN(ustat),			"ustat"			},
@@ -341,7 +341,7 @@
 [375] = { 3,	TM,		SEN(mincore),			"mincore"		},
 [376] = { 3,	0,		SEN(printargs),			"pciconfig_iobase"	},
 [377] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
-[378] = { 0,	0,		SEN(gettid),			"gettid"		},
+[378] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [379] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [380] = { },
 [381] = { 2,	TS,		SEN(kill),			"tkill"			},
diff --git a/linux/arc/syscallent.h b/linux/arc/syscallent.h
index 5847dc4..1100008 100644
--- a/linux/arc/syscallent.h
+++ b/linux/arc/syscallent.h
@@ -1,4 +1,4 @@
-#define ARCH_mmap mmap_pgoff
+#define sys_ARCH_mmap sys_mmap_pgoff
 #include "32/syscallent.h"
 [244] = { 3,	0,	SEN(printargs),	"arc_cacheflush"},
 [245] = { 1,	0,	SEN(printargs),	"arc_settls"	},
diff --git a/linux/arm/get_scno.c b/linux/arm/get_scno.c
index d9b6ffc..23a167c 100644
--- a/linux/arm/get_scno.c
+++ b/linux/arm/get_scno.c
@@ -1,3 +1,32 @@
+/*
+ * 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>
+ * 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.
+ */
+
 /* Return codes: 1 - ok, 0 - ignore, other - error. */
 static int
 arch_get_scno(struct tcb *tcp)
diff --git a/linux/arm/syscallent.h b/linux/arm/syscallent.h
index 5538dfe..0a24cae 100644
--- a/linux/arm/syscallent.h
+++ b/linux/arm/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -249,7 +249,7 @@
 [220] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	0,		SEN(gettid),			"gettid"		},
+[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [225] = { 5,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/avr32/syscallent.h b/linux/avr32/syscallent.h
index 626b08c..e4c11fc 100644
--- a/linux/avr32/syscallent.h
+++ b/linux/avr32/syscallent.h
@@ -32,7 +32,7 @@
 [  4] = { 3,	TD,		SEN(write),			"write"			},
 [  5] = { 3,	TD|TF,		SEN(open),			"open"			},
 [  6] = { 1,	TD,		SEN(close),			"close"			},
-[  7] = { 1,	0,		SEN(umask),			"umask"			},
+[  7] = { 1,	NF,		SEN(umask),			"umask"			},
 [  8] = { 2,	TD|TF,		SEN(creat),			"creat"			},
 [  9] = { 2,	TF,		SEN(link),			"link"			},
 [ 10] = { 1,	TF,		SEN(unlink),			"unlink"		},
@@ -45,7 +45,7 @@
 [ 17] = { 3,	TF,		SEN(chown),			"lchown"		},
 [ 18] = { 3,	TD,		SEN(lseek),			"lseek"			},
 [ 19] = { 5,	TD,		SEN(llseek),			"_llseek"		},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount2),			"umount2"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -89,7 +89,7 @@
 [ 61] = { 2,	0,		SEN(setregid),			"setregid"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 4,	TS,		SEN(rt_sigaction),		"rt_sigaction"		},
@@ -146,7 +146,7 @@
 [118] = { 1,	0,		SEN(getpgid),			"getpgid"		},
 [119] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [120] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[121] = { 1,	0,		SEN(personality),		"personality"		},
+[121] = { 1,	NF,		SEN(personality),		"personality"		},
 [122] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [123] = { 3,	TD,		SEN(getdents),			"getdents"		},
 [124] = { 2,	TD,		SEN(flock),			"flock"			},
@@ -201,7 +201,7 @@
 [173] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [174] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [175] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
-[176] = { 0,	0,		SEN(gettid),			"gettid"		},
+[176] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [177] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [178] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [179] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/bfin/syscallent.h b/linux/bfin/syscallent.h
index c30e731..f338704 100644
--- a/linux/bfin/syscallent.h
+++ b/linux/bfin/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -249,7 +249,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	0,		SEN(gettid),			"gettid"		},
+[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/hppa/syscallent.h b/linux/hppa/syscallent.h
index f6b7549..104dbb5 100644
--- a/linux/hppa/syscallent.h
+++ b/linux/hppa/syscallent.h
@@ -22,7 +22,7 @@
 [ 17] = { 3,	TN,		SEN(socket),			"socket"		},
 [ 18] = { 2,	TF,		SEN(stat),			"stat"			},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 3,	TN,		SEN(bind),			"bind"			},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -62,11 +62,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 4,	TN,		SEN(send),			"send"			},
 [ 59] = { 1,	0,		SEN(uname),			"uname"			},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
@@ -138,7 +138,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[136] = { 1,	NF,		SEN(personality),		"personality"		},
 [137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [138] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [139] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -208,7 +208,7 @@
 [203] = { 5,	0,		SEN(printargs),			"attrctl"		},
 [204] = { 5,	0,		SEN(printargs),			"acl_get"		},
 [205] = { 5,	0,		SEN(printargs),			"acl_set"		},
-[206] = { 0,	0,		SEN(gettid),			"gettid"		},
+[206] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [207] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile64"		},
diff --git a/linux/i386/syscallent.h b/linux/i386/syscallent.h
index 20ba789..db89215 100644
--- a/linux/i386/syscallent.h
+++ b/linux/i386/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -249,7 +249,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	0,		SEN(gettid),			"gettid"		},
+[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/ia64/get_error.c b/linux/ia64/get_error.c
index 09dfdef..52daa7f 100644
--- a/linux/ia64/get_error.c
+++ b/linux/ia64/get_error.c
@@ -10,7 +10,7 @@
 			tcp->u_rval = err;
 		}
 	} else {
-		if (check_errno && ia64_regs.gr[10]) {
+		if (ia64_regs.gr[10]) {
 			tcp->u_rval = -1;
 			tcp->u_error = ia64_regs.gr[8];
 		} else {
diff --git a/linux/ia64/syscallent.h b/linux/ia64/syscallent.h
index 3bfa347..c703aa1 100644
--- a/linux/ia64/syscallent.h
+++ b/linux/ia64/syscallent.h
@@ -34,7 +34,7 @@
 #define SYS_FUNC_NAME(syscall_name) printargs
 #include "../i386/syscallent.h"
 #undef SYS_FUNC_NAME
-#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(sys_ ## syscall_name)
+#define SYS_FUNC_NAME(syscall_name) MPERS_FUNC_NAME(syscall_name)
 
 /* You must be careful to check ../i386/syscallent.h so that this table
    starts where that one leaves off.
@@ -57,8 +57,8 @@
 [1038] = { 2,	TF,		SEN(chmod),			"chmod"			},
 [1039] = { 3,	TF,		SEN(chown),			"chown"			},
 [1040] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[1041] = { 0,	0,		SEN(getpid),			"getpid"		},
-[1042] = { 0,	0,		SEN(getppid),			"getppid"		},
+[1041] = { 0,	NF,		SEN(getpid),			"getpid"		},
+[1042] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [1043] = { 5,	TF,		SEN(mount),			"mount"			},
 [1044] = { 2,	TF,		SEN(umount2),			"umount"		},
 [1045] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -83,7 +83,7 @@
 [1064] = { 1,	TF,		SEN(acct),			"acct"			},
 [1065] = { 3,	TD,		SEN(ioctl),			"ioctl"			},
 [1066] = { 3,	TD,		SEN(fcntl),			"fcntl"			},
-[1067] = { 1,	0,		SEN(umask),			"umask"			},
+[1067] = { 1,	NF,		SEN(umask),			"umask"			},
 [1068] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [1069] = { 2,	0,		SEN(ustat),			"ustat"			},
 [1070] = { 2,	TD,		SEN(dup2),			"dup2"			},
@@ -121,7 +121,7 @@
 [1102] = { 3,	0,		SEN(setpriority),		"setpriority"		},
 [1103] = { 2,	TF,		SEN(statfs),			"statfs"		},
 [1104] = { 2,	TD,		SEN(fstatfs),			"fstatfs"		},
-[1105] = { 3,	0,		SEN(gettid),			"gettid"		},
+[1105] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [1106] = { 3,	TI,		SEN(semget),			"semget"		},
 [1107] = { 3,	TI,		SEN(semop),			"semop"			},
 [1108] = { 4,	TI,		SEN(semctl),			"semctl"		},
@@ -156,7 +156,7 @@
 [1137] = { 4,	TF,		SEN(quotactl),			"quotactl"		},
 [1138] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [1139] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[1140] = { 1,	0,		SEN(personality),		"personality"		},
+[1140] = { 1,	NF,		SEN(personality),		"personality"		},
 [1141] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [1142] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [1143] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -362,3 +362,4 @@
 [1343] = { 1,	TD,		SEN(userfaultfd),		"userfaultfd",		},
 [1344] = { 2,	0,		SEN(membarrier),		"membarrier",		},
 [1345] = { 5,	0,		SEN(kcmp),			"kcmp"			},
+[1346] = { 3,	TM,		SEN(mlock2),			"mlock2"		},
diff --git a/linux/m68k/syscallent.h b/linux/m68k/syscallent.h
index c3ce07d..d6e0bf4 100644
--- a/linux/m68k/syscallent.h
+++ b/linux/m68k/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -246,7 +246,7 @@
 [217] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
 [218 ... 219] = { },
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
-[221] = { 0,	0,		SEN(gettid),			"gettid"		},
+[221] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [222] = { 2,	TS,		SEN(kill),			"tkill"			},
 [223] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [224] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/microblaze/syscallent.h b/linux/microblaze/syscallent.h
index 0336a56..7341e13 100644
--- a/linux/microblaze/syscallent.h
+++ b/linux/microblaze/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -249,7 +249,7 @@
 [220] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [221] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [222 ... 223] = { },
-[224] = { 0,	0,		SEN(gettid),			"gettid"		},
+[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/mips/get_error.c b/linux/mips/get_error.c
index e58055e..42a282b 100644
--- a/linux/mips/get_error.c
+++ b/linux/mips/get_error.c
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && mips_REG_A3) {
+	if (mips_REG_A3) {
 		tcp->u_rval = -1;
 		tcp->u_error = mips_REG_V0;
 	} else {
diff --git a/linux/mips/syscallent-n32.h b/linux/mips/syscallent-n32.h
index f97511d..85e8c78 100644
--- a/linux/mips/syscallent-n32.h
+++ b/linux/mips/syscallent-n32.h
@@ -38,7 +38,7 @@
 [6035] = { 2,	0,		SEN(getitimer),			"getitimer"		},
 [6036] = { 3,	0,		SEN(setitimer),			"setitimer"		},
 [6037] = { 1,	0,		SEN(alarm),			"alarm"			},
-[6038] = { 0,	0,		SEN(getpid),			"getpid"		},
+[6038] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [6039] = { 4,	TD|TN,		SEN(sendfile),			"sendfile"		},
 [6040] = { 3,	TN,		SEN(socket),			"socket"		},
 [6041] = { 3,	TN,		SEN(connect),			"connect"		},
@@ -93,7 +93,7 @@
 [6090] = { 3,	TF,		SEN(chown),			"chown"			},
 [6091] = { 3,	TD,		SEN(fchown),			"fchown"		},
 [6092] = { 3,	TF,		SEN(chown),			"lchown"		},
-[6093] = { 1,	0,		SEN(umask),			"umask"			},
+[6093] = { 1,	NF,		SEN(umask),			"umask"			},
 [6094] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [6095] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [6096] = { 2,	0,		SEN(getrusage),			"getrusage"		},
@@ -108,7 +108,7 @@
 [6105] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
 [6106] = { 0,	NF,		SEN(getegid),			"getegid"		},
 [6107] = { 2,	0,		SEN(setpgid),			"setpgid"		},
-[6108] = { 0,	0,		SEN(getppid),			"getppid"		},
+[6108] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [6109] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [6110] = { 0,	0,		SEN(setsid),			"setsid"		},
 [6111] = { 2,	0,		SEN(setreuid),			"setreuid"		},
@@ -132,7 +132,7 @@
 [6129] = { 2,	TS,		SEN(sigaltstack),		"sigaltstack"		},
 [6130] = { 2,	TF,		SEN(utime),			"utime"			},
 [6131] = { 3,	TF,		SEN(mknod),			"mknod"			},
-[6132] = { 1,	0,		SEN(personality),		"personality"		},
+[6132] = { 1,	NF,		SEN(personality),		"personality"		},
 [6133] = { 2,	0,		SEN(ustat),			"ustat"			},
 [6134] = { 3,	TF,		SEN(statfs),			"statfs"		},
 [6135] = { 3,	TD,		SEN(fstatfs),			"fstatfs"		},
@@ -178,7 +178,7 @@
 [6175] = { 5,	TN,		SEN(putpmsg),			"putpmsg"		},
 [6176] = { 0,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [6177] = { 0,	0,		SEN(printargs),			"reserved177"		},
-[6178] = { 0,	0,		SEN(gettid),			"gettid"		},
+[6178] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [6179] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [6180] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [6181] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/mips/syscallent-n64.h b/linux/mips/syscallent-n64.h
index 9f32038..7341abc 100644
--- a/linux/mips/syscallent-n64.h
+++ b/linux/mips/syscallent-n64.h
@@ -38,7 +38,7 @@
 [5035] = { 2,	0,		SEN(getitimer),			"getitimer"		},
 [5036] = { 3,	0,		SEN(setitimer),			"setitimer"		},
 [5037] = { 1,	0,		SEN(alarm),			"alarm"			},
-[5038] = { 0,	0,		SEN(getpid),			"getpid"		},
+[5038] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [5039] = { 4,	TD|TN,		SEN(sendfile),			"sendfile"		},
 [5040] = { 3,	TN,		SEN(socket),			"socket"		},
 [5041] = { 3,	TN,		SEN(connect),			"connect"		},
@@ -93,7 +93,7 @@
 [5090] = { 3,	TF,		SEN(chown),			"chown"			},
 [5091] = { 3,	TD,		SEN(fchown),			"fchown"		},
 [5092] = { 3,	TF,		SEN(chown),			"lchown"		},
-[5093] = { 1,	0,		SEN(umask),			"umask"			},
+[5093] = { 1,	NF,		SEN(umask),			"umask"			},
 [5094] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [5095] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [5096] = { 2,	0,		SEN(getrusage),			"getrusage"		},
@@ -108,7 +108,7 @@
 [5105] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
 [5106] = { 0,	NF,		SEN(getegid),			"getegid"		},
 [5107] = { 2,	0,		SEN(setpgid),			"setpgid"		},
-[5108] = { 0,	0,		SEN(getppid),			"getppid"		},
+[5108] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [5109] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [5110] = { 0,	0,		SEN(setsid),			"setsid"		},
 [5111] = { 2,	0,		SEN(setreuid),			"setreuid"		},
@@ -132,7 +132,7 @@
 [5129] = { 2,	TS,		SEN(sigaltstack),		"sigaltstack"		},
 [5130] = { 2,	TF,		SEN(utime),			"utime"			},
 [5131] = { 3,	TF,		SEN(mknod),			"mknod"			},
-[5132] = { 1,	0,		SEN(personality),		"personality"		},
+[5132] = { 1,	NF,		SEN(personality),		"personality"		},
 [5133] = { 2,	0,		SEN(ustat),			"ustat"			},
 [5134] = { 3,	TF,		SEN(statfs),			"statfs"		},
 [5135] = { 3,	TD,		SEN(fstatfs),			"fstatfs"		},
@@ -178,7 +178,7 @@
 [5175] = { 5,	TN,		SEN(putpmsg),			"putpmsg"		},
 [5176] = { 0,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [5177] = { 0,	0,		SEN(printargs),			"reserved177"		},
-[5178] = { 0,	0,		SEN(gettid),			"gettid"		},
+[5178] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [5179] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [5180] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [5181] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/mips/syscallent-o32.h b/linux/mips/syscallent-o32.h
index ab1f6c5..79c2cee 100644
--- a/linux/mips/syscallent-o32.h
+++ b/linux/mips/syscallent-o32.h
@@ -20,7 +20,7 @@
 [4017] = { 0,	TM,		SEN(break),			"break"			},
 [4018] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [4019] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[4020] = { 0,	0,		SEN(getpid),			"getpid"		},
+[4020] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [4021] = { 5,	TF,		SEN(mount),			"mount"			},
 [4022] = { 1,	TF,		SEN(umount),			"umount"		},
 [4023] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -60,11 +60,11 @@
 [4057] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [4058] = { 0,	0,		SEN(ulimit),			"ulimit"		},
 [4059] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[4060] = { 1,	0,		SEN(umask),			"umask"			},
+[4060] = { 1,	NF,		SEN(umask),			"umask"			},
 [4061] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [4062] = { 2,	0,		SEN(ustat),			"ustat"			},
 [4063] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[4064] = { 0,	0,		SEN(getppid),			"getppid"		},
+[4064] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [4065] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [4066] = { 0,	0,		SEN(setsid),			"setsid"		},
 [4067] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -136,7 +136,7 @@
 [4133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [4134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [4135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[4136] = { 1,	0,		SEN(personality),		"personality"		},
+[4136] = { 1,	NF,		SEN(personality),		"personality"		},
 [4137] = { 0,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [4138] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [4139] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -222,7 +222,7 @@
 [4219] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [4220] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [4221] = { },
-[4222] = { 0,	0,		SEN(gettid),			"gettid"		},
+[4222] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [4223] = { 5,	TD,		SEN(readahead),			"readahead"		},
 [4224] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [4225] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/nios2/get_error.c b/linux/nios2/get_error.c
index 52c05ad..1c91c0a 100644
--- a/linux/nios2/get_error.c
+++ b/linux/nios2/get_error.c
@@ -8,7 +8,7 @@
 	 * the system call success, r7=1 indicates an error.  The positive
 	 * errno value written in r2.
 	 */
-	if (check_errno && nios2_regs.regs[7]) {
+	if (nios2_regs.regs[7]) {
 		tcp->u_rval = -1;
 		tcp->u_error = nios2_regs.regs[2];
 	} else {
diff --git a/linux/nios2/syscallent.h b/linux/nios2/syscallent.h
index 8a4b70e..01efe3a 100644
--- a/linux/nios2/syscallent.h
+++ b/linux/nios2/syscallent.h
@@ -1,4 +1,4 @@
-#define ARCH_mmap mmap_pgoff
+#define sys_ARCH_mmap sys_mmap_pgoff
 #include "32/syscallent.h"
 [244] = {4,    0,	SEN(cacheflush), "cacheflush"},
 [245 ... 259] = { },
diff --git a/linux/or1k/syscallent.h b/linux/or1k/syscallent.h
index ed84b3b..351fe25 100644
--- a/linux/or1k/syscallent.h
+++ b/linux/or1k/syscallent.h
@@ -1,4 +1,4 @@
-#define ARCH_mmap mmap_pgoff
+#define sys_ARCH_mmap sys_mmap_pgoff
 #include "32/syscallent.h"
 [244] = { 3,	NF,	SEN(or1k_atomic),	"or1k_atomic"	},
 [245 ... 259] = { },
diff --git a/linux/powerpc/get_error.c b/linux/powerpc/get_error.c
index 41506fb..8f10612 100644
--- a/linux/powerpc/get_error.c
+++ b/linux/powerpc/get_error.c
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && (ppc_regs.ccr & 0x10000000)) {
+	if (ppc_regs.ccr & 0x10000000) {
 		tcp->u_rval = -1;
 		tcp->u_error = ppc_regs.gpr[3];
 	} else {
diff --git a/linux/powerpc/syscallent.h b/linux/powerpc/syscallent.h
index 741be44..a0d9730 100644
--- a/linux/powerpc/syscallent.h
+++ b/linux/powerpc/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[136] = { 1,	NF,		SEN(personality),		"personality"		},
 [137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [138] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [139] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -233,7 +233,7 @@
 [204] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [205] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [206] = { 3,	TM,		SEN(mincore),			"mincore"		},
-[207] = { 0,	0,		SEN(gettid),			"gettid"		},
+[207] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [210] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/powerpc64/syscallent.h b/linux/powerpc64/syscallent.h
index 81152af..0bf55ea 100644
--- a/linux/powerpc64/syscallent.h
+++ b/linux/powerpc64/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[136] = { 1,	NF,		SEN(personality),		"personality"		},
 [137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [138] = { 1,	NF,		SEN(setfsuid),			"setfsuid"		},
 [139] = { 1,	NF,		SEN(setfsgid),			"setfsgid"		},
@@ -228,7 +228,7 @@
 [204] = { },
 [205] = { 3,	TM,		SEN(madvise),			"madvise"		},
 [206] = { 3,	TM,		SEN(mincore),			"mincore"		},
-[207] = { 0,	0,		SEN(gettid),			"gettid"		},
+[207] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [208] = { 2,	TS,		SEN(kill),			"tkill"			},
 [209] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [210] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/s390/syscallent.h b/linux/s390/syscallent.h
index ad2827a..96097d4 100644
--- a/linux/s390/syscallent.h
+++ b/linux/s390/syscallent.h
@@ -48,7 +48,7 @@
 [ 17] = { },
 [ 18] = { },
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -88,11 +88,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { },
 [ 59] = { },
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -164,7 +164,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -264,7 +264,7 @@
 [233] = { 2,	TF,		SEN(removexattr),		"removexattr"		},
 [234] = { 2,	TF,		SEN(removexattr),		"lremovexattr"		},
 [235] = { 2,	TD,		SEN(fremovexattr),		"fremovexattr"		},
-[236] = { 0,	0,		SEN(gettid),			"gettid"		},
+[236] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [237] = { 2,	TS,		SEN(kill),			"tkill"			},
 [238] = { 6,	0,		SEN(futex),			"futex"			},
 [239] = { 3,	0,		SEN(sched_setaffinity),		"sched_setaffinity"	},
diff --git a/linux/s390x/syscallent.h b/linux/s390x/syscallent.h
index a43526d..9f11018 100644
--- a/linux/s390x/syscallent.h
+++ b/linux/s390x/syscallent.h
@@ -47,7 +47,7 @@
 [ 17] = { },
 [ 18] = { },
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { },
@@ -87,11 +87,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { },
 [ 59] = { },
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -158,7 +158,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[136] = { 1,	NF,		SEN(personality),		"personality"		},
 [137] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [138 ... 140] = { },
 [141] = { 3,	TD,		SEN(getdents),			"getdents"		},
@@ -248,7 +248,7 @@
 [233] = { 2,	TF,		SEN(removexattr),		"removexattr"		},
 [234] = { 2,	TF,		SEN(removexattr),		"lremovexattr"		},
 [235] = { 2,	TD,		SEN(fremovexattr),		"fremovexattr"		},
-[236] = { 0,	0,		SEN(gettid),			"gettid"		},
+[236] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [237] = { 2,	TS,		SEN(kill),			"tkill"			},
 [238] = { 6,	0,		SEN(futex),			"futex"			},
 [239] = { 3,	0,		SEN(sched_setaffinity),		"sched_setaffinity"	},
diff --git a/linux/sh/syscallent.h b/linux/sh/syscallent.h
index 4715d27..d3ece3f 100644
--- a/linux/sh/syscallent.h
+++ b/linux/sh/syscallent.h
@@ -48,7 +48,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -88,11 +88,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -164,7 +164,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -228,13 +228,13 @@
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
 [199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
 [200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	0,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	0,		SEN(getegid),			"getegid32"		},
+[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,	0,		SEN(fchown),			"fchown32"		},
+[207] = { 3,	TD,		SEN(fchown),			"fchown32"		},
 [208] = { 3,	0,		SEN(setresuid),			"setresuid32"		},
 [209] = { 3,	0,		SEN(getresuid),			"getresuid32"		},
 [210] = { 3,	0,		SEN(setresgid),			"setresgid32"		},
@@ -242,15 +242,15 @@
 [212] = { 3,	TF,		SEN(chown),			"chown32"		},
 [213] = { 1,	0,		SEN(setuid),			"setuid32"		},
 [214] = { 1,	0,		SEN(setgid),			"setgid32"		},
-[215] = { 1,	0,		SEN(setfsuid),			"setfsuid32"		},
-[216] = { 1,	0,		SEN(setfsgid),			"setfsgid32"		},
+[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"		},
 [222 ... 223] = { },
-[224] = { 4,	0,		SEN(gettid),			"gettid"		},
+[224] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [225] = { 4,	TD,		SEN(readahead),			"readahead"		},
 [226] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [227] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/sh64/syscallent.h b/linux/sh64/syscallent.h
index 614ba81..df6b1b9 100644
--- a/linux/sh64/syscallent.h
+++ b/linux/sh64/syscallent.h
@@ -46,7 +46,7 @@
 [ 17] = { 0,	TM,		SEN(break),			"break"			},
 [ 18] = { 2,	TF,		SEN(oldstat),			"oldstat"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 5,	TF,		SEN(mount),			"mount"			},
 [ 22] = { 1,	TF,		SEN(umount),			"umount"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -86,11 +86,11 @@
 [ 57] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [ 58] = { 2,	0,		SEN(ulimit),			"ulimit"		},
 [ 59] = { 1,	0,		SEN(oldolduname),		"oldolduname"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	0,		SEN(ustat),			"ustat"			},
 [ 63] = { 2,	TD,		SEN(dup2),			"dup2"			},
-[ 64] = { 0,	0,		SEN(getppid),			"getppid"		},
+[ 64] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [ 65] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [ 66] = { 0,	0,		SEN(setsid),			"setsid"		},
 [ 67] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
@@ -162,7 +162,7 @@
 [133] = { 1,	TD,		SEN(fchdir),			"fchdir"		},
 [134] = { 2,	0,		SEN(bdflush),			"bdflush"		},
 [135] = { 3,	0,		SEN(sysfs),			"sysfs"			},
-[136] = { 1,	0,		SEN(personality),		"personality"		},
+[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"		},
@@ -226,13 +226,13 @@
 [198] = { 3,	TF,		SEN(chown),			"lchown32"		},
 [199] = { 0,	NF,		SEN(getuid),			"getuid32"		},
 [200] = { 0,	NF,		SEN(getgid),			"getgid32"		},
-[201] = { 0,	0,		SEN(geteuid),			"geteuid32"		},
-[202] = { 0,	0,		SEN(getegid),			"getegid32"		},
+[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,	0,		SEN(fchown),			"fchown32"		},
+[207] = { 3,	TD,		SEN(fchown),			"fchown32"		},
 [208] = { 3,	0,		SEN(setresuid),			"setresuid32"		},
 [209] = { 3,	0,		SEN(getresuid),			"getresuid32"		},
 [210] = { 3,	0,		SEN(setresgid),			"setresgid32"		},
@@ -240,8 +240,8 @@
 [212] = { 3,	TF,		SEN(chown),			"chown32"		},
 [213] = { 1,	0,		SEN(setuid),			"setuid32"		},
 [214] = { 1,	0,		SEN(setgid),			"setgid32"		},
-[215] = { 1,	0,		SEN(setfsuid),			"setfsuid32"		},
-[216] = { 1,	0,		SEN(setfsgid),			"setfsgid32"		},
+[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"		},
@@ -276,7 +276,7 @@
 [248] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [249] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
 [250 ... 251] = { },
-[252] = { 4,	0,		SEN(gettid),			"gettid"		},
+[252] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [253] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [254] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [255] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/sparc/get_error.c b/linux/sparc/get_error.c
index fa57ed0..1b960ac 100644
--- a/linux/sparc/get_error.c
+++ b/linux/sparc/get_error.c
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && sparc_regs.psr & PSR_C) {
+	if (sparc_regs.psr & PSR_C) {
 		tcp->u_rval = -1;
 		tcp->u_error = sparc_regs.u_regs[U_REG_O0];
 	} else {
diff --git a/linux/sparc/syscallent.h b/linux/sparc/syscallent.h
index a41f732..256cace 100644
--- a/linux/sparc/syscallent.h
+++ b/linux/sparc/syscallent.h
@@ -18,7 +18,7 @@
 [ 17] = { 1,	TM|SI,		SEN(brk),			"brk"			},
 [ 18] = { 4,	0,		SEN(printargs),			"perfctr"		},
 [ 19] = { 3,	TD,		SEN(lseek),			"lseek"			},
-[ 20] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 20] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 21] = { 2,	0,		SEN(capget),			"capget"		},
 [ 22] = { 2,	0,		SEN(capset),			"capset"		},
 [ 23] = { 1,	0,		SEN(setuid16),			"setuid"		},
@@ -58,7 +58,7 @@
 [ 57] = { 2,	TF,		SEN(symlink),			"symlink"		},
 [ 58] = { 3,	TF,		SEN(readlink),			"readlink"		},
 [ 59] = { 3,	TF|TP|SE|SI,	SEN(execve),			"execve"		},
-[ 60] = { 1,	0,		SEN(umask),			"umask"			},
+[ 60] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 61] = { 1,	TF,		SEN(chroot),			"chroot"		},
 [ 62] = { 2,	TD,		SEN(fstat),			"fstat"			},
 [ 63] = { 2,	TD,		SEN(fstat64),			"fstat64"		},
@@ -141,7 +141,7 @@
 [140] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile64"		},
 [141] = { 3,	TN,		SEN(getpeername),		"getpeername"		},
 [142] = { 6,	0,		SEN(futex),			"futex"			},
-[143] = { 0,	0,		SEN(gettid),			"gettid"		},
+[143] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [144] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [145] = { 2,	0,		SEN(setrlimit),			"setrlimit"		},
 [146] = { 2,	TF,		SEN(pivotroot),			"pivot_root"		},
@@ -189,13 +189,13 @@
 [188] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
 [189] = { 1,	0,		SEN(uname),			"uname"			},
 [190] = { 3,	0,		SEN(init_module),		"init_module"		},
-[191] = { 1,	0,		SEN(personality),		"personality"		},
+[191] = { 1,	NF,		SEN(personality),		"personality"		},
 [192] = { 5,	TM|SI,		SEN(remap_file_pages),		"remap_file_pages"	},
 [193] = { 1,	TD,		SEN(epoll_create),		"epoll_create"		},
 [194] = { 4,	TD,		SEN(epoll_ctl),			"epoll_ctl"		},
 [195] = { 4,	TD,		SEN(epoll_wait),		"epoll_wait"		},
 [196] = { 3,	0,		SEN(ioprio_set),		"ioprio_set"		},
-[197] = { 0,	0,		SEN(getppid),			"getppid"		},
+[197] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [198] = { 3,	TS,		SEN(sigaction),			"sigaction"		},
 [199] = { 0,	TS,		SEN(siggetmask),		"sgetmask"		},
 [200] = { 1,	TS,		SEN(sigsetmask),		"ssetmask"		},
diff --git a/linux/sparc64/get_error.c b/linux/sparc64/get_error.c
index bacd04f..8f8978b 100644
--- a/linux/sparc64/get_error.c
+++ b/linux/sparc64/get_error.c
@@ -1,7 +1,7 @@
 static void
 get_error(struct tcb *tcp, const bool check_errno)
 {
-	if (check_errno && sparc_regs.tstate & 0x1100000000UL) {
+	if (sparc_regs.tstate & 0x1100000000UL) {
 		tcp->u_rval = -1;
 		tcp->u_error = sparc_regs.u_regs[U_REG_O0];
 	} else {
diff --git a/linux/subcall.h b/linux/subcall.h
index 3b70b6d..c5ead53 100644
--- a/linux/subcall.h
+++ b/linux/subcall.h
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2013-2015 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 SYS_socket_subcall
 # error SYS_socket_subcall is not defined
 #endif
diff --git a/linux/tile/syscallent1.h b/linux/tile/syscallent1.h
index c86f059..28dbab4 100644
--- a/linux/tile/syscallent1.h
+++ b/linux/tile/syscallent1.h
@@ -1,4 +1,4 @@
-#define ARCH_mmap mmap_4koff
+#define sys_ARCH_mmap sys_mmap_4koff
 #define ARCH_WANT_SYNC_FILE_RANGE2 1
 #include "32/syscallent.h"
 [244] = { 1,	0,	SEN(printargs),	"cmpxchg_badaddr"	},
diff --git a/linux/x32/syscallent.h b/linux/x32/syscallent.h
index ecd2cce..b3b4814 100644
--- a/linux/x32/syscallent.h
+++ b/linux/x32/syscallent.h
@@ -37,7 +37,7 @@
 [ 36] = { 2,	0,		SEN(getitimer),			"getitimer"		},
 [ 37] = { 1,	0,		SEN(alarm),			"alarm"			},
 [ 38] = { 3,	0,		SEN(setitimer),			"setitimer"		},
-[ 39] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 39] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 40] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile"		},
 [ 41] = { 3,	TN,		SEN(socket),			"socket"		},
 [ 42] = { 3,	TN,		SEN(connect),			"connect"		},
@@ -93,7 +93,7 @@
 [ 92] = { 3,	TF,		SEN(chown),			"chown"			},
 [ 93] = { 3,	TD,		SEN(fchown),			"fchown"		},
 [ 94] = { 3,	TF,		SEN(chown),			"lchown"		},
-[ 95] = { 1,	0,		SEN(umask),			"umask"			},
+[ 95] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 96] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [ 97] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [ 98] = { 2,	0,		SEN(getrusage),			"getrusage"		},
@@ -108,7 +108,7 @@
 [107] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
 [108] = { 0,	NF,		SEN(getegid),			"getegid"		},
 [109] = { 2,	0,		SEN(setpgid),			"setpgid"		},
-[110] = { 0,	0,		SEN(getppid),			"getppid"		},
+[110] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [111] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [112] = { 0,	0,		SEN(setsid),			"setsid"		},
 [113] = { 2,	0,		SEN(setreuid),			"setreuid"		},
@@ -133,7 +133,7 @@
 [132] = { 2,	TF,		SEN(utime),			"utime"			},
 [133] = { 3,	TF,		SEN(mknod),			"mknod"			},
 [134] = { 1,	TF,		SEN(printargs),			"64:uselib"		},
-[135] = { 1,	0,		SEN(personality),		"personality"		},
+[135] = { 1,	NF,		SEN(personality),		"personality"		},
 [136] = { 2,	0,		SEN(ustat),			"ustat"			},
 [137] = { 2,	TF,		SEN(statfs),			"statfs"		},
 [138] = { 2,	TD,		SEN(fstatfs),			"fstatfs"		},
@@ -184,7 +184,7 @@
 [183] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [184] = { 3,	0,		SEN(tuxcall),			"tuxcall"		},
 [185] = { 3,	0,		SEN(security),			"security"		},
-[186] = { 0,	0,		SEN(gettid),			"gettid"		},
+[186] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [187] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [188] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [189] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/x86_64/get_scno.c b/linux/x86_64/get_scno.c
index 8b163de..af3329a 100644
--- a/linux/x86_64/get_scno.c
+++ b/linux/x86_64/get_scno.c
@@ -1,3 +1,35 @@
+/*
+ * Copyright (c) 2002 Andi Kleen <ak@suse.de>
+ * Copyright (c) 2002 Michal Ludvig <mludvig@suse.cz>
+ * Copyright (c) 2002 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2008-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2010-2015 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.
+ */
+
 /* Return codes: 1 - ok, 0 - ignore, other - error. */
 static int
 arch_get_scno(struct tcb *tcp)
diff --git a/linux/x86_64/getregs_old.c b/linux/x86_64/getregs_old.c
index 0ad340f..9f7c248 100644
--- a/linux/x86_64/getregs_old.c
+++ b/linux/x86_64/getregs_old.c
@@ -1,4 +1,32 @@
 /*
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2013-2015 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.
+ */
+
+/*
  * PTRACE_GETREGSET was added to the kernel in v2.6.25,
  * a PTRACE_GETREGS based fallback is provided for old kernels.
  */
diff --git a/linux/x86_64/syscallent.h b/linux/x86_64/syscallent.h
index 1fd47e0..18f00ec 100644
--- a/linux/x86_64/syscallent.h
+++ b/linux/x86_64/syscallent.h
@@ -37,7 +37,7 @@
 [ 36] = { 2,	0,		SEN(getitimer),			"getitimer"		},
 [ 37] = { 1,	0,		SEN(alarm),			"alarm"			},
 [ 38] = { 3,	0,		SEN(setitimer),			"setitimer"		},
-[ 39] = { 0,	0,		SEN(getpid),			"getpid"		},
+[ 39] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [ 40] = { 4,	TD|TN,		SEN(sendfile64),		"sendfile"		},
 [ 41] = { 3,	TN,		SEN(socket),			"socket"		},
 [ 42] = { 3,	TN,		SEN(connect),			"connect"		},
@@ -93,7 +93,7 @@
 [ 92] = { 3,	TF,		SEN(chown),			"chown"			},
 [ 93] = { 3,	TD,		SEN(fchown),			"fchown"		},
 [ 94] = { 3,	TF,		SEN(chown),			"lchown"		},
-[ 95] = { 1,	0,		SEN(umask),			"umask"			},
+[ 95] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 96] = { 2,	0,		SEN(gettimeofday),		"gettimeofday"		},
 [ 97] = { 2,	0,		SEN(getrlimit),			"getrlimit"		},
 [ 98] = { 2,	0,		SEN(getrusage),			"getrusage"		},
@@ -108,7 +108,7 @@
 [107] = { 0,	NF,		SEN(geteuid),			"geteuid"		},
 [108] = { 0,	NF,		SEN(getegid),			"getegid"		},
 [109] = { 2,	0,		SEN(setpgid),			"setpgid"		},
-[110] = { 0,	0,		SEN(getppid),			"getppid"		},
+[110] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [111] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [112] = { 0,	0,		SEN(setsid),			"setsid"		},
 [113] = { 2,	0,		SEN(setreuid),			"setreuid"		},
@@ -133,7 +133,7 @@
 [132] = { 2,	TF,		SEN(utime),			"utime"			},
 [133] = { 3,	TF,		SEN(mknod),			"mknod"			},
 [134] = { 1,	TF,		SEN(uselib),			"uselib"		},
-[135] = { 1,	0,		SEN(personality),		"personality"		},
+[135] = { 1,	NF,		SEN(personality),		"personality"		},
 [136] = { 2,	0,		SEN(ustat),			"ustat"			},
 [137] = { 2,	TF,		SEN(statfs),			"statfs"		},
 [138] = { 2,	TD,		SEN(fstatfs),			"fstatfs"		},
@@ -184,7 +184,7 @@
 [183] = { 5,	0,		SEN(afs_syscall),		"afs_syscall"		},
 [184] = { 3,	0,		SEN(tuxcall),			"tuxcall"		},
 [185] = { 3,	0,		SEN(security),			"security"		},
-[186] = { 0,	0,		SEN(gettid),			"gettid"		},
+[186] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [187] = { 3,	TD,		SEN(readahead),			"readahead"		},
 [188] = { 5,	TF,		SEN(setxattr),			"setxattr"		},
 [189] = { 5,	TF,		SEN(setxattr),			"lsetxattr"		},
diff --git a/linux/xtensa/syscallent.h b/linux/xtensa/syscallent.h
index 9f936f0..5f07c2f 100644
--- a/linux/xtensa/syscallent.h
+++ b/linux/xtensa/syscallent.h
@@ -51,7 +51,7 @@
 [ 55] = { 2,	TD,		SEN(fstat64),			"fstat64"		},
 [ 56] = { 2,	TD,		SEN(flock),			"flock"			},
 [ 57] = { 2,	TF,		SEN(access),			"access"		},
-[ 58] = { 1,	0,		SEN(umask),			"umask"			},
+[ 58] = { 1,	NF,		SEN(umask),			"umask"			},
 [ 59] = { 3,	TD,		SEN(getdents),			"getdents"		},
 [ 60] = { 3,	TD,		SEN(getdents64),		"getdents64"		},
 [ 61] = { 3,	TD,		SEN(fcntl64),			"fcntl64"		},
@@ -113,18 +113,18 @@
 [117] = { 3,	TF|TP|SE|SI,	SEN(execve),			"execve"		},
 [118] = { 1,	TP|SE,		SEN(exit),			"exit"			},
 [119] = { 1,	TP|SE,		SEN(exit),			"exit_group"		},
-[120] = { 0,	0,		SEN(getpid),			"getpid"		},
+[120] = { 0,	NF,		SEN(getpid),			"getpid"		},
 [121] = { 4,	TP,		SEN(wait4),			"wait4"			},
 [122] = { 5,	TP,		SEN(waitid),			"waitid"		},
 [123] = { 2,	TS,		SEN(kill),			"kill"			},
 [124] = { 2,	TS,		SEN(kill),			"tkill"			},
 [125] = { 3,	TS,		SEN(tgkill),			"tgkill"		},
 [126] = { 1,	0,		SEN(set_tid_address),		"set_tid_address"	},
-[127] = { 0,	0,		SEN(gettid),			"gettid"		},
+[127] = { 0,	NF,		SEN(gettid),			"gettid"		},
 [128] = { 0,	0,		SEN(setsid),			"setsid"		},
 [129] = { 1,	0,		SEN(getsid),			"getsid"		},
 [130] = { 5,	0,		SEN(prctl),			"prctl"			},
-[131] = { 1,	0,		SEN(personality),		"personality"		},
+[131] = { 1,	NF,		SEN(personality),		"personality"		},
 [132] = { 2,	0,		SEN(getpriority),		"getpriority"		},
 [133] = { 3,	0,		SEN(setpriority),		"setpriority"		},
 [134] = { 3,	0,		SEN(setitimer),			"setitimer"		},
@@ -143,7 +143,7 @@
 [147] = { 3,	0,		SEN(getresgid),			"getresgid"		},
 [148] = { 2,	0,		SEN(setpgid),			"setpgid"		},
 [149] = { 1,	0,		SEN(getpgid),			"getpgid"		},
-[150] = { 0,	0,		SEN(getppid),			"getppid"		},
+[150] = { 0,	NF,		SEN(getppid),			"getppid"		},
 [151] = { 0,	0,		SEN(getpgrp),			"getpgrp"		},
 [152 ... 153] = { },
 [154] = { 1,	0,		SEN(times),			"times"			},
diff --git a/lookup_dcookie.c b/lookup_dcookie.c
index c6482b3..c95e593 100644
--- a/lookup_dcookie.c
+++ b/lookup_dcookie.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 SYS_FUNC(lookup_dcookie)
diff --git a/lseek.c b/lseek.c
index 8d8f21b..fe4b695 100644
--- a/lseek.c
+++ b/lseek.c
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2009 Andreas Schwab <schwab@redhat.com>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include "xlat/whence_codes.h"
diff --git a/m4/long_long.m4 b/m4/long_long.m4
deleted file mode 100644
index e6d22f0..0000000
--- a/m4/long_long.m4
+++ /dev/null
@@ -1,29 +0,0 @@
-dnl ### A macro to determine endianness of long long
-AC_DEFUN([AC_LITTLE_ENDIAN_LONG_LONG],
-[AC_MSG_CHECKING(for little endian long long)
-AC_CACHE_VAL(ac_cv_have_little_endian_long_long,
-[AC_RUN_IFELSE([AC_LANG_SOURCE([[
-int main () {
-	union {
-		long long ll;
-		int l [2];
-	} u;
-	u.ll = 0x12345678;
-	if (u.l[0] == 0x12345678)
-		return 0;
-	return 1;
-}
-]])],[ac_cv_have_little_endian_long_long=yes],[ac_cv_have_little_endian_long_long=no],[
-if test "x$ac_cv_c_bigendian" = "xyes"; then
-	ac_cv_have_little_endian_long_long=no
-else
-	ac_cv_have_little_endian_long_long=yes
-fi
-])])
-AC_MSG_RESULT($ac_cv_have_little_endian_long_long)
-if test "$ac_cv_have_little_endian_long_long" = yes
-then
-	AC_DEFINE([HAVE_LITTLE_ENDIAN_LONG_LONG], 1,
-[Define if long long is little-endian.])
-fi
-])
diff --git a/m4/mpers.m4 b/m4/mpers.m4
index 70933ff..1fe8a8e 100644
--- a/m4/mpers.m4
+++ b/m4/mpers.m4
@@ -1,3 +1,31 @@
+#!/usr/bin/m4
+#
+# Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# 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.
+
 AC_DEFUN([st_MPERS],[
 
 pushdef([MPERS_NAME], translit([$1], [a-z], [A-Z]))
diff --git a/membarrier.c b/membarrier.c
index 783a708..485c62a 100644
--- a/membarrier.c
+++ b/membarrier.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include "xlat/membarrier_cmds.h"
diff --git a/memfd_create.c b/memfd_create.c
index fcd370f..7c14077 100644
--- a/memfd_create.c
+++ b/memfd_create.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include "xlat/memfd_create_flags.h"
diff --git a/mknod.c b/mknod.c
index a7aa774..ca19068 100644
--- a/mknod.c
+++ b/mknod.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
@@ -49,26 +82,3 @@
 
 	return RVAL_DECODED;
 }
-
-#if defined(SPARC) || defined(SPARC64)
-SYS_FUNC(xmknod)
-{
-	int mode = tcp->u_arg[2];
-
-	tprintf("%ld, ", tcp->u_arg[0]);
-	printpath(tcp, tcp->u_arg[1]);
-	tprintf(", %s", sprintmode(mode));
-	switch (mode & S_IFMT) {
-	case S_IFCHR:
-	case S_IFBLK:
-		tprintf(", makedev(%lu, %lu)",
-			(unsigned long) ((tcp->u_arg[3] >> 18) & 0x3fff),
-			(unsigned long) (tcp->u_arg[3] & 0x3ffff));
-		break;
-	default:
-		break;
-	}
-
-	return RVAL_DECODED;
-}
-#endif /* SPARC || SPARC64 */
diff --git a/mount.c b/mount.c
index 51c7b3e..84e79d6 100644
--- a/mount.c
+++ b/mount.c
@@ -1,3 +1,35 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #define MS_MGC_VAL	0xc0ed0000	/* old magic mount flag number */
diff --git a/mpers.awk b/mpers.awk
index d9cf8b3..73bf0b0 100644
--- a/mpers.awk
+++ b/mpers.awk
@@ -1,3 +1,31 @@
+#!/bin/gawk
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2015 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.
+
 function compare_indices(i1, v1, i2, v2) {
 	c1 = strtonum(sprintf("%s", i1))
 	c2 = strtonum(sprintf("%s", i2))
@@ -5,41 +33,79 @@
 		return -1
 	return (c1 != c2)
 }
+function array_get(array_idx, array_member, array_return)
+{
+	array_return = array[array_idx][array_member]
+	if ("" == array_return) {
+		printf("%s: index [%s] without %s\n",
+		       FILENAME, array_idx, array_member) > "/dev/stderr"
+		exit 1
+	}
+	return array_return
+}
+function array_seq(array_idx)
+{
+	if ("seq" in array[array_idx])
+		return array[array_idx]["seq"]
+	index_seq++
+	array[array_idx]["seq"] = index_seq
+	return index_seq
+}
+function enter(array_idx)
+{
+	if (array_idx in called) {
+		printf("%s: index loop detected:", FILENAME) > "/dev/stderr"
+		for (item in called)
+			printf(" %s", item) > "/dev/stderr"
+		print "" > "/dev/stderr"
+		exit 1
+	}
+	called[array_idx] = 1
+}
+function leave(array_idx, to_return)
+{
+	delete called[array_idx]
+	return to_return
+}
 function what_is(what_idx, type_idx, special, item, \
 		 location, prev_location, prev_returned_size)
 {
-	type_idx = array[what_idx]["type"]
-	special = array[what_idx]["special"]
+	enter(what_idx)
+	special = array_get(what_idx, "special")
 	switch (special) {
 	case "base_type":
-		switch (array[what_idx]["encoding"]) {
+		switch (array_get(what_idx, "encoding")) {
 		case 5: # signed
-			printf("%s ", "int" \
-			8*array[what_idx]["byte_size"] "_t")
+			printf("int%s_t ",
+			       8 * array_get(what_idx, "byte_size"))
 			break
 		case 7: # unsigned
-			printf("%s ", "uint" \
-			8*array[what_idx]["byte_size"] "_t")
+			printf("uint%s_t ",
+			       8 * array_get(what_idx, "byte_size"))
 			break
 		default: # float, signed/unsigned char
-			printf("%s ", array[what_idx]["name"])
+			printf("%s ", array_get(what_idx, "name"))
 			break
 		}
-		returned_size = array[what_idx]["byte_size"]
+		returned_size = array_get(what_idx, "byte_size")
 		break
 	case "enumeration_type":
-		printf("%s ", "uint" 8*array[type_idx]["byte_size"] "_t")
-		returned_size = array[what_idx]["byte_size"]
+		type_idx = array_get(what_idx, "type")
+		returned_size = array_get(what_idx, "byte_size")
+		printf("uint%s_t ", 8 * returned_size)
 		break
 	case "pointer_type":
-		printf("%s", "mpers_ptr_t ")
-		returned_size = array[what_idx]["byte_size"]
+		printf("mpers_ptr_t ")
+		returned_size = array_get(what_idx, "byte_size")
 		break
 	case "array_type":
+		type_idx = array_get(what_idx, "type")
 		what_is(type_idx)
 		to_return = array[what_idx]["upper_bound"]
-		returned_size = array[what_idx]["upper_bound"] * returned_size
-		return to_return
+		if ("" == to_return)
+			to_return = 0
+		returned_size = to_return * returned_size
+		return leave(what_idx, to_return)
 		break
 	case "structure_type":
 		print "struct {"
@@ -49,60 +115,62 @@
 		prev_returned_size = 0
 		for (item in array) {
 			if ("parent" in array[item] && \
-				array[item]["parent"] == what_idx) {
-				location = array[item]["location"]
+				array_get(item, "parent") == what_idx) {
+				location = array_get(item, "location")
 				loc_diff = location - prev_location - \
 					prev_returned_size
 				if (loc_diff != 0) {
-					printf("%s", \
-						"unsigned char mpers_filler_" \
-						item "[" loc_diff "];\n")
+					printf("unsigned char mpers_%s_%s[%s];\n",
+					       "filler", array_seq(item), loc_diff)
 				}
 				prev_location = location
 				returned = what_is(item)
 				prev_returned_size = returned_size
 				printf("%s", array[item]["name"])
-				if (returned) {
-					printf("%s", "[" returned "]")
+				if ("" != returned) {
+					printf("[%s]", returned)
 				}
 				print ";"
 			}
 		}
-		returned_size = array[what_idx]["byte_size"]
+		returned_size = array_get(what_idx, "byte_size")
 		loc_diff = returned_size - prev_location - prev_returned_size
 		if (loc_diff != 0) {
-			printf("%s", "unsigned char mpers_end_filler_" \
-				item "[" loc_diff "];\n")
+			printf("unsigned char mpers_%s_%s[%s];\n",
+			       "end_filler", array_seq(item), loc_diff)
 		}
-		printf("%s", "} ATTRIBUTE_PACKED ")
+		printf("} ATTRIBUTE_PACKED ")
 		break
 	case "union_type":
 		print "union {"
 		for (item in array) {
 			if ("parent" in array[item] && \
-				array[item]["parent"] == what_idx) {
+				array_get(item, "parent") == what_idx) {
 				returned = what_is(item)
-				printf("%s", array[item]["name"])
-				if (returned) {
-					printf("%s", "[" returned "]")
+				printf("%s", array_get(item, "name"))
+				if ("" != returned) {
+					printf("[%s]", returned)
 				}
 				print ";"
 			}
 		}
-		printf("%s", "} ")
-		returned_size = array[what_idx]["byte_size"]
+		printf("} ")
+		returned_size = array_get(what_idx, "byte_size")
 		break
 	case "typedef":
-		return what_is(type_idx)
+		type_idx = array_get(what_idx, "type")
+		return leave(what_idx, what_is(type_idx))
 		break
 	case "member":
-		return what_is(type_idx)
+		type_idx = array_get(what_idx, "type")
+		return leave(what_idx, what_is(type_idx))
 		break
 	default:
+		type_idx = array_get(what_idx, "type")
 		what_is(type_idx)
 		break
 	}
-	return 0
+	return leave(what_idx, "")
 }
 BEGIN {
 	print "#include <inttypes.h>"
@@ -118,8 +186,9 @@
 	}
 }
 /^DW_AT_data_member_location/ {
-	match($0, /[[:digit:]]+/, temparray)
-	array[idx]["location"] = temparray[0]
+	if (!match($0, /\(DW_OP_plus_uconst:[[:space:]]+([[:digit:]]+)\)/, temparray))
+		match($0, /([[:digit:]]+)/, temparray)
+	array[idx]["location"] = temparray[1]
 }
 /^DW_AT_name/ {
 	match($0, /:[[:space:]]+([[:alpha:]_][[:alnum:]_[:space:]]*)/, \
@@ -153,19 +222,20 @@
 	for (item in array) {
 		if (array[item]["special"] == "pointer_type") {
 			print "typedef uint" \
-				8*array[item]["byte_size"] "_t mpers_ptr_t;"
+				8 * array_get(item, "byte_size") "_t mpers_ptr_t;"
 			break
 		}
 	}
 	for (item in array) {
 		if (array[item]["name"] == VAR_NAME) {
-			type=array[item]["type"]
+			type = array_get(item, "type")
 			print "typedef"
-			what_is(array[item]["type"])
-			print ARCH_FLAG "_" array[type]["name"] ";"
+			what_is(type)
+			name = array_get(type, "name")
+			print ARCH_FLAG "_" name ";"
 			print "#define MPERS_" \
-				ARCH_FLAG "_" array[type]["name"] " " \
-				ARCH_FLAG "_" array[type]["name"]
+				ARCH_FLAG "_" name " " \
+				ARCH_FLAG "_" name
 			break
 		}
 	}
diff --git a/mpers.sh b/mpers.sh
index fc681a4..559d1f4 100755
--- a/mpers.sh
+++ b/mpers.sh
@@ -1,4 +1,29 @@
 #!/bin/sh -e
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# 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.
 
 export LC_ALL=C
 
@@ -7,7 +32,7 @@
 PARSER_FILE=$2
 
 CC="${CC-gcc}"
-CFLAGS="$CFLAGS -gdwarf-4 -c"
+CFLAGS="$CFLAGS -gdwarf-2 -c"
 CPP="${CPP-$CC -E}"
 CPPFLAGS="$CPPFLAGS -MM -MG"
 
diff --git a/mpers_test.sh b/mpers_test.sh
index e788446..72b5f5d 100755
--- a/mpers_test.sh
+++ b/mpers_test.sh
@@ -1,6 +1,35 @@
 #!/bin/sh -efu
+#
+# Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+# Copyright (c) 2015 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.
 
 mpers_name="$1"; shift
+size="$(printf %s "$mpers_name" |tr -cd '[0-9]')"
+[ "$size" -gt 0 ]
+
 srcdir=${0%/*}
 mpers_sh="${srcdir}/mpers.sh"
 
@@ -10,19 +39,89 @@
 sample="$mpers_dir/sample.c"
 cat > "$sample" <<EOF
 #include "mpers_type.h"
-#include DEF_MPERS_TYPE(int)
+#include DEF_MPERS_TYPE(sample_struct)
+typedef struct {
+	struct {
+		void *p;
+		char sc;
+		/* unsigned char mpers_filler_1[1]; */
+		short ss;
+		unsigned char uc;
+		/* unsigned char mpers_filler_2[3]; */
+		int si;
+		unsigned ui;
+		long sl;
+		unsigned short us;
+		/* unsigned char mpers_filler_3[6]; */
+		long long sll __attribute__((__aligned__(8)));
+		unsigned long long ull;
+		unsigned long ul;
+		long asl[3];
+		char f;
+		/* unsigned char mpers_end_filler_4[7]; */
+	} s;
+	union {
+		long long sll;
+		unsigned long long ull;
+		void *p;
+		long sl;
+		unsigned long ul;
+		int si;
+		unsigned ui;
+		short ss;
+		unsigned short us;
+		char sc;
+		unsigned char uc;
+	} u[3];
+	short f[0];
+} sample_struct;
 #include MPERS_DEFS
 EOF
 
 expected="$mpers_dir/sample.expected"
 cat > "$expected" <<EOF
 #include <inttypes.h>
+typedef uint${size}_t mpers_ptr_t;
 typedef
-int32_t ${mpers_name}_int;
-#define MPERS_${mpers_name}_int ${mpers_name}_int
+struct {
+struct {
+mpers_ptr_t p;
+char sc;
+unsigned char mpers_filler_1[1];
+int16_t ss;
+unsigned char uc;
+unsigned char mpers_filler_2[3];
+int32_t si;
+uint32_t ui;
+int${size}_t sl;
+uint16_t us;
+unsigned char mpers_filler_3[6];
+int64_t sll;
+uint64_t ull;
+uint${size}_t ul;
+int${size}_t asl[3];
+char f;
+unsigned char mpers_end_filler_4[7];
+} ATTRIBUTE_PACKED s;
+union {
+int64_t sll;
+uint64_t ull;
+mpers_ptr_t p;
+int${size}_t sl;
+uint${size}_t ul;
+int32_t si;
+uint32_t ui;
+int16_t ss;
+uint16_t us;
+char sc;
+unsigned char uc;
+} u[3];
+int16_t f[0];
+} ATTRIBUTE_PACKED ${mpers_name}_sample_struct;
+#define MPERS_${mpers_name}_sample_struct ${mpers_name}_sample_struct
 EOF
 
 CFLAGS="$CPPFLAGS -I${srcdir}" \
 CPPFLAGS="$CPPFLAGS -I${srcdir} -DIN_MPERS -DMPERS_IS_${mpers_name}" \
 "$mpers_sh" "-$mpers_name" "$sample"
-cmp "$expected" "$mpers_dir"/int.h > /dev/null
+cmp "$expected" "$mpers_dir"/sample_struct.h > /dev/null
diff --git a/mpers_type.h b/mpers_type.h
index fe606e8..adbefd5 100644
--- a/mpers_type.h
+++ b/mpers_type.h
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef IN_MPERS
 # define STRINGIFY(a) #a
 # define DEF_MPERS_TYPE(args) STRINGIFY(args.h)
diff --git a/open.c b/open.c
index 974f50c..9bd1b95 100644
--- a/open.c
+++ b/open.c
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993, 1994, 1995, 1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2006-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
diff --git a/or1k_atomic.c b/or1k_atomic.c
index 458d6d4..a5755c6 100644
--- a/or1k_atomic.c
+++ b/or1k_atomic.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2013 Christian Svensson <blue@cmd.nu>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef OR1K
diff --git a/pathtrace.c b/pathtrace.c
index d530ec2..e72cdf7 100644
--- a/pathtrace.c
+++ b/pathtrace.c
@@ -216,6 +216,7 @@
 	case SEN_mmap:
 	case SEN_mmap_4koff:
 	case SEN_mmap_pgoff:
+	case SEN_ARCH_mmap:
 		/* x, x, x, x, fd */
 		return fdmatch(tcp, tcp->u_arg[4]);
 
diff --git a/perf.c b/perf.c
index 613ecb1..f91b9d3 100644
--- a/perf.c
+++ b/perf.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2013 Ben Noordhuis <info@bnoordhuis.nl>
+ * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef HAVE_LINUX_PERF_EVENT_H
diff --git a/personality.c b/personality.c
index 5c425c6..44ed5e3 100644
--- a/personality.c
+++ b/personality.c
@@ -1,12 +1,69 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
-
 #include <linux/personality.h>
+#include "xlat/personality_types.h"
+#include "xlat/personality_flags.h"
 
-#include "xlat/personality_options.h"
 
 SYS_FUNC(personality)
 {
-	printxval(personality_options, tcp->u_arg[0], "PER_???");
+	unsigned int pers;
 
-	return RVAL_DECODED;
+	if (entering(tcp)) {
+		pers = tcp->u_arg[0];
+		if (0xffffffff == pers) {
+			tprints("0xffffffff");
+		} else {
+			printxval(personality_types, pers & PER_MASK, "PER_???");
+			pers &= ~PER_MASK;
+			if (pers) {
+				tprints("|");
+				printflags(personality_flags, pers, NULL);
+			}
+		}
+		return 0;
+	}
+
+	if (syserror(tcp))
+		return 0;
+
+	pers = tcp->u_rval;
+	const char *type = xlookup(personality_types, pers & PER_MASK);
+	char *p;
+	static char outstr[1024];
+	if (type)
+		p = stpcpy(outstr, type);
+	else
+		p = outstr + sprintf(outstr, "%#x /* %s */", pers & PER_MASK, "PER_???");
+	pers &= ~PER_MASK;
+	if (pers)
+		strcpy(p, sprintflags("|", personality_flags, pers));
+	tcp->auxstr = outstr;
+	return RVAL_HEX | RVAL_STR;
 }
diff --git a/prctl.c b/prctl.c
index fa16c5c..53ee56e 100644
--- a/prctl.c
+++ b/prctl.c
@@ -1,3 +1,33 @@
+/*
+ * Copyright (c) 1994-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-2000 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2007 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <sys/prctl.h>
diff --git a/print_time.c b/print_time.c
index 4d38766..dddb3f1 100644
--- a/print_time.c
+++ b/print_time.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include DEF_MPERS_TYPE(time_t)
diff --git a/printmode.c b/printmode.c
index a721936..8ff05fc 100644
--- a/printmode.c
+++ b/printmode.c
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
diff --git a/printsiginfo.c b/printsiginfo.c
index fac7a44..4083e19 100644
--- a/printsiginfo.c
+++ b/printsiginfo.c
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2001 John Hughes <john@Calva.COM>
+ * Copyright (c) 2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include DEF_MPERS_TYPE(siginfo_t)
diff --git a/printstat.h b/printstat.h
index 0908355..c7e1bb2 100644
--- a/printstat.h
+++ b/printstat.h
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1999-2003 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2004 David S. Miller <davem@nuts.davemloft.net>
+ * Copyright (c) 2003-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2007 Jan Kratochvil <jan.kratochvil@redhat.com>
+ * Copyright (c) 2009 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2009-2010 Andreas Schwab <schwab@linux-m68k.org>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2005-2015 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 DO_PRINTSTAT
 # define DO_PRINTSTAT do_printstat
 #endif
diff --git a/process_vm.c b/process_vm.c
index 24934d4..82e1e16 100644
--- a/process_vm.c
+++ b/process_vm.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 SYS_FUNC(process_vm_readv)
diff --git a/ptp.c b/ptp.c
index f6cc1ab..69880e1 100644
--- a/ptp.c
+++ b/ptp.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2014 Stefan Sørensen <stefan.sorensen@spectralink.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <linux/ioctl.h>
 #include <linux/ptp_clock.h>
diff --git a/ptrace.h b/ptrace.h
index 31739c3..d8af976 100644
--- a/ptrace.h
+++ b/ptrace.h
@@ -1,3 +1,38 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2010 Wang Chao <wang.chao@cn.fujitsu.com>
+ * Copyright (c) 2011-2013 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2011-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2013 Ali Polatel <alip@exherbo.org>
+ * Copyright (c) 2015 Mike Frysinger <vapier@gentoo.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.
+ */
+
 #ifdef NEED_PTRACE_PROTOTYPE_WORKAROUND
 # define ptrace xptrace
 # include <sys/ptrace.h>
diff --git a/readlink.c b/readlink.c
index 9929761..299b083 100644
--- a/readlink.c
+++ b/readlink.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 static int
diff --git a/sched.c b/sched.c
index e473046..e193498 100644
--- a/sched.c
+++ b/sched.c
@@ -1,3 +1,32 @@
+/*
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <sched.h>
diff --git a/sigaltstack.c b/sigaltstack.c
index cd02794..b3e4357 100644
--- a/sigaltstack.c
+++ b/sigaltstack.c
@@ -1,3 +1,35 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include DEF_MPERS_TYPE(stack_t)
diff --git a/signalfd.c b/signalfd.c
index 4cfd6de..8ddf871 100644
--- a/signalfd.c
+++ b/signalfd.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2008-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <fcntl.h>
 #ifdef HAVE_SYS_SIGNALFD_H
diff --git a/socketutils.c b/socketutils.c
index 93f5f16..f0faf8c 100644
--- a/socketutils.c
+++ b/socketutils.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2014 Zubin Mithra <zubin.mithra@gmail.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <netinet/in.h>
 #include <sys/socket.h>
diff --git a/statfs.c b/statfs.c
index d851aa7..bd3c7ba 100644
--- a/statfs.c
+++ b/statfs.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2012 Andreas Schwab <schwab@linux-m68k.org>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #ifdef HAVE_SYS_VFS_H
 # include <sys/vfs.h>
diff --git a/strace.spec b/strace.spec
index 8165d0d..1f14eb7 100644
--- a/strace.spec
+++ b/strace.spec
@@ -1,14 +1,16 @@
 Summary: Tracks and displays system calls associated with a running process
 Name: strace
-Version: 4.10
-Release: 1%{?dist}
+Version: 4.11
+Release: 2%{?dist}
 License: BSD
 Group: Development/Debuggers
 URL: http://sourceforge.net/projects/strace/
 Source: http://downloads.sourceforge.net/strace/%{name}-%{version}.tar.xz
-
-BuildRequires: libacl-devel, time
-
+BuildRequires: time
+%ifarch x86_64
+# for experimental -k option
+BuildRequires: libunwind-devel
+%endif
 %define strace64_arches ppc64 sparc64
 
 %description
@@ -79,6 +81,19 @@
 %endif
 
 %changelog
+* Wed Dec 23 2015 Dmitry V. Levin <ldv@altlinux.org> - 4.11-2
+- Enabled experimental -k option on x86_64 (#1170296).
+
+* Mon Dec 21 2015 Dmitry V. Levin <ldv@altlinux.org> - 4.11-1
+- New upstream release:
+  + print nanoseconds along with seconds in stat family syscalls (#1251176).
+
+* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 4.10-3
+- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
+
+* Mon May 11 2015 Marcin Juszkiewicz <mjuszkiewicz@redhat.com> - 4.10-2
+- Backport set of upstream patches to get it buildable on AArch64
+
 * Fri Mar 06 2015 Dmitry V. Levin <ldv@altlinux.org> - 4.10-1
 - New upstream release:
   + enhanced ioctl decoding (#902788).
diff --git a/sync_file_range.c b/sync_file_range.c
index 4f6cbed..8e6afa0 100644
--- a/sync_file_range.c
+++ b/sync_file_range.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2013 William Manley <william.manley@youview.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <fcntl.h>
diff --git a/syscall.c b/syscall.c
index 66154f7..8d81274 100644
--- a/syscall.c
+++ b/syscall.c
@@ -82,8 +82,7 @@
 #define SI STACKTRACE_INVALIDATE_CACHE
 #define SE STACKTRACE_CAPTURE_ON_ENTER
 
-#define SEN_NAME(syscall_name) SEN_ ## syscall_name
-#define SEN(syscall_name) SEN_NAME(syscall_name), SYS_FUNC_NAME(syscall_name)
+#define SEN(syscall_name) SEN_ ## syscall_name, SYS_FUNC_NAME(sys_ ## syscall_name)
 
 const struct_sysent sysent0[] = {
 #include "syscallent.h"
@@ -105,7 +104,6 @@
 
 /* Now undef them since short defines cause wicked namespace pollution. */
 #undef SEN
-#undef SEN_NAME
 #undef TD
 #undef TF
 #undef TI
diff --git a/sysctl.c b/sysctl.c
index 24d948a..03e98c1 100644
--- a/sysctl.c
+++ b/sysctl.c
@@ -1,3 +1,32 @@
+/*
+ * Copyright (c) 1999 Ulrich Drepper <drepper@cygnus.com>
+ * Copyright (c) 2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <linux/sysctl.h>
diff --git a/sysinfo.c b/sysinfo.c
index 46f4ed2..e418f95 100644
--- a/sysinfo.c
+++ b/sysinfo.c
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2012 Denys Vlasenko <vda.linux@googlemail.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include DEF_MPERS_TYPE(sysinfo_t)
 #include <sys/sysinfo.h>
diff --git a/syslog.c b/syslog.c
index e270060..6be941c 100644
--- a/syslog.c
+++ b/syslog.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 enum {
diff --git a/sysmips.c b/sysmips.c
index a47facf..10b102a 100644
--- a/sysmips.c
+++ b/sysmips.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2001 Wichert Akkerman <wichert@deephackmode.org>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef MIPS
diff --git a/test/.gitignore b/test/.gitignore
index fba8c9d..34d37bf 100644
--- a/test/.gitignore
+++ b/test/.gitignore
@@ -1,6 +1,5 @@
 childthread
 clone
-fork
 leaderkill
 many_looping_threads
 mmap_offset_decode
@@ -12,7 +11,6 @@
 skodic
 threaded_execve
 ubi
-vfork
 wait_must_be_interruptible
 x32_lseek
 x32_mmap
diff --git a/test/Makefile b/test/Makefile
index dbc5008..ad727fc 100644
--- a/test/Makefile
+++ b/test/Makefile
@@ -1,7 +1,7 @@
 CFLAGS += -Wall
 
 PROGS = \
-    vfork fork sig skodic clone leaderkill childthread \
+    sig skodic clone leaderkill childthread \
     sigkill_rain wait_must_be_interruptible threaded_execve \
     mtd ubi seccomp sfd mmap_offset_decode x32_lseek x32_mmap \
     many_looping_threads
diff --git a/tests/.gitignore b/tests/.gitignore
index 6cc56cc..1891eee 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -21,6 +21,7 @@
 fcntl64
 file_handle
 filter-unavailable
+fork-f
 fstat
 fstat64
 fstatat64
@@ -38,6 +39,7 @@
 ipc_sem
 ipc_shm
 ksysent
+ksysent.h
 llseek
 lseek
 lstat
@@ -56,6 +58,7 @@
 newfstatat
 oldselect
 pc
+personality
 pipe
 ppoll
 pselect6
@@ -100,6 +103,7 @@
 userfaultfd
 utime
 utimensat
+vfork-f
 wait
 xattr
 xet_robust_list
diff --git a/tests/Makefile.am b/tests/Makefile.am
index fdeb5ec..6c8f07c 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,4 +1,29 @@
 # Automake input for strace tests.
+#
+# Copyright (c) 2011-2015 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.
 
 OS = linux
 ARCH = @arch@
@@ -31,6 +56,7 @@
 	fcntl64 \
 	file_handle \
 	filter-unavailable \
+	fork-f \
 	fstat \
 	fstat64 \
 	fstatat64 \
@@ -66,6 +92,7 @@
 	newfstatat \
 	oldselect \
 	pc \
+	personality \
 	pipe \
 	ppoll \
 	pselect6 \
@@ -110,6 +137,7 @@
 	userfaultfd \
 	utime \
 	utimensat \
+	vfork-f \
 	wait \
 	xattr \
 	xet_robust_list \
@@ -158,6 +186,7 @@
 	fcntl64.test \
 	file_handle.test \
 	filter-unavailable.test \
+	fork-f.test \
 	fstat.test \
 	fstat64.test \
 	fstatat64.test \
@@ -191,6 +220,7 @@
 	newfstatat.test \
 	oldselect.test \
 	pc.test \
+	personality.test \
 	pipe.test \
 	ppoll.test \
 	pselect6.test \
@@ -233,6 +263,7 @@
 	userfaultfd.test \
 	utime.test \
 	utimensat.test \
+	vfork-f.test \
 	wait.test \
 	xattr.test \
 	xet_robust_list.test \
diff --git a/tests/aio.c b/tests/aio.c
index 08974e1..e3a073a 100644
--- a/tests/aio.c
+++ b/tests/aio.c
@@ -33,6 +33,7 @@
 #include <errno.h>
 #include <inttypes.h>
 #include <stdio.h>
+#include <time.h>
 #include <unistd.h>
 #include <sys/fcntl.h>
 #include <sys/syscall.h>
diff --git a/tests/bexecve.test b/tests/bexecve.test
index 2706481..f1ab04f 100755
--- a/tests/bexecve.test
+++ b/tests/bexecve.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check -bexecve behavior.
+#
+# Copyright (c) 2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/bpf.c b/tests/bpf.c
index 636fae8..daa4e74 100644
--- a/tests/bpf.c
+++ b/tests/bpf.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/caps.awk b/tests/caps.awk
index f2f143d..bad8b0f 100644
--- a/tests/caps.awk
+++ b/tests/caps.awk
@@ -1,3 +1,30 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
 	cap = "(0|CAP_[A-Z_]+(\\|CAP_[A-Z_]+)*|CAP_[A-Z_]+(\\|CAP_[A-Z_]+){37}\\|0xffffffc0)"
 	r[1] = "^capget\\(\\{_LINUX_CAPABILITY_VERSION_3, 0\\}, \\{" cap ", " cap ", " cap "\\}\\) = 0$"
diff --git a/tests/caps.c b/tests/caps.c
index 918d6a8..c00e3d4 100644
--- a/tests/caps.c
+++ b/tests/caps.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <errno.h>
 
 extern int capget(int *, int *);
diff --git a/tests/count.test b/tests/count.test
index 9c53fe2..60d2c73 100755
--- a/tests/count.test
+++ b/tests/count.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check whether -c and -w options work.
+#
+# Copyright (c) 2014-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/detach-running.test b/tests/detach-running.test
index 595a505..b77dc51 100755
--- a/tests/detach-running.test
+++ b/tests/detach-running.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Ensure that strace can detach from running processes.
+#
+# Copyright (c) 2013-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/detach-sleeping.test b/tests/detach-sleeping.test
index 345d7d0..546c21d 100755
--- a/tests/detach-sleeping.test
+++ b/tests/detach-sleeping.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Ensure that strace can detach from sleeping processes.
+#
+# Copyright (c) 2013-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/detach-stopped.test b/tests/detach-stopped.test
index 1c11c10..ca4d4e9 100755
--- a/tests/detach-stopped.test
+++ b/tests/detach-stopped.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Ensure that strace can detach from stopped processes.
+#
+# Copyright (c) 2013-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/epoll_create1.c b/tests/epoll_create1.c
index 4e4c422..66bcf9e 100644
--- a/tests/epoll_create1.c
+++ b/tests/epoll_create1.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/eventfd.c b/tests/eventfd.c
index 046dd1a..5de0c22 100644
--- a/tests/eventfd.c
+++ b/tests/eventfd.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/execve.c b/tests/execve.c
index 69f6f5f..0959978 100644
--- a/tests/execve.c
+++ b/tests/execve.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <unistd.h>
 
 #define FILENAME "execve\nfilename"
diff --git a/tests/execveat.c b/tests/execveat.c
index 4363c94..7d7257d 100644
--- a/tests/execveat.c
+++ b/tests/execveat.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/filter-unavailable.c b/tests/filter-unavailable.c
index 6f865e6..2151c9a 100644
--- a/tests/filter-unavailable.c
+++ b/tests/filter-unavailable.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tests/fork-f.c b/tests/fork-f.c
new file mode 100644
index 0000000..a1a45b9
--- /dev/null
+++ b/tests/fork-f.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+static int
+logit(const char *const str)
+{
+	return pwrite(-1, str, strlen(str), 0) >= 0;
+}
+
+int main(int ac, char **av, char **ep)
+{
+	if (ac < 1)
+		return 1;
+	if (ac > 1)
+		return logit(av[1]);
+
+	logit("start");
+
+	int fds[2];
+	(void) close(0);
+	if (pipe(fds)) {
+		perror("pipe");
+		return 77;
+	}
+
+	pid_t pid = fork();
+
+	if (pid < 0) {
+		perror("fork");
+		return 77;
+	}
+
+	if (!pid) {
+		close(fds[1]);
+
+		if (read(0, fds, sizeof(int)))
+			_exit(2);
+
+		char *const args[] = { av[0], (char *) "exec", NULL };
+		if (logit("child") || execve(args[0], args, args + 1))
+			_exit(2);
+	}
+
+	close(0);
+
+	logit("parent");
+	close(fds[1]);
+
+	int status;
+	if (wait(&status) != pid) {
+		perror("wait");
+		return 77;
+	}
+	if (status) {
+		fprintf(stderr, "status = %d\n", status);
+		return 77;
+	}
+
+	logit("finish");
+
+	pid_t ppid = getpid();
+	close(-1);
+	printf("%-5d pwrite64(-1, \"start\", 5, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"parent\", 6, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"child\", 5, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"exec\", 4, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"finish\", 6, 0) = -1 EBADF (%m)\n",
+	       ppid, ppid, pid, pid, ppid);
+	return 0;
+}
diff --git a/tests/fork-f.test b/tests/fork-f.test
new file mode 100755
index 0000000..8fdf062
--- /dev/null
+++ b/tests/fork-f.test
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Check how strace -f follows fork syscall.
+
+. "${srcdir=.}/init.sh"
+
+run_prog > /dev/null
+OUT="$LOG.out"
+run_strace -a32 -qq -f -epwrite64 -esignal=none $args > "$OUT"
+match_diff "$LOG" "$OUT"
+rm -f "$OUT"
+
+exit 0
diff --git a/tests/fstatat.c b/tests/fstatat.c
index cc5e3de..5c08a78 100644
--- a/tests/fstatat.c
+++ b/tests/fstatat.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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 HAVE_FSTATAT
 # undef TEST_SYSCALL_NAME
 #endif
diff --git a/tests/fstatx.c b/tests/fstatx.c
index 04bb3a6..ef17a79 100644
--- a/tests/fstatx.c
+++ b/tests/fstatx.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #define TEST_SYSCALL_INVOKE(sample, pst) \
 	syscall(TEST_SYSCALL_NR, 0, pst)
 #define PRINT_SYSCALL_HEADER(sample) \
diff --git a/tests/ftruncate.c b/tests/ftruncate.c
index 1f21f63..d10a90d 100644
--- a/tests/ftruncate.c
+++ b/tests/ftruncate.c
@@ -53,7 +53,7 @@
 	if (rc != -1 || EBADF != errno)
 		return 77;
 
-	printf("ftruncate(-1, %Lu) = -1 EBADF (Bad file descriptor)\n",
+	printf("ftruncate(-1, %llu) = -1 EBADF (Bad file descriptor)\n",
 	       (unsigned long long) len);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/ftruncate64.c b/tests/ftruncate64.c
index 7dfbf6b..ee865b1 100644
--- a/tests/ftruncate64.c
+++ b/tests/ftruncate64.c
@@ -46,7 +46,7 @@
 	if (rc != -1 || EBADF != errno)
 		return 77;
 
-	printf("ftruncate64(-1, %Lu) = -1 EBADF (Bad file descriptor)\n",
+	printf("ftruncate64(-1, %llu) = -1 EBADF (Bad file descriptor)\n",
 	       (unsigned long long) len);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/getdents.c b/tests/getdents.c
index cfa69c2..6df3202 100644
--- a/tests/getdents.c
+++ b/tests/getdents.c
@@ -83,7 +83,7 @@
 	int d_name_len = d->d_reclen - d_name_offset - 1;
 	assert(d_name_len > 0);
 
-	printf("{d_ino=%Lu, d_off=%Lu, d_reclen=%u, d_name=",
+	printf("{d_ino=%llu, d_off=%llu, d_reclen=%u, d_name=",
 	       (unsigned long long) d->d_ino,
 	       (unsigned long long) d->d_off, d->d_reclen);
 
diff --git a/tests/inet-accept-connect-send-recv.c b/tests/inet-accept-connect-send-recv.c
index 7cd079f..87387ed 100644
--- a/tests/inet-accept-connect-send-recv.c
+++ b/tests/inet-accept-connect-send-recv.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <stddef.h>
 #include <stdio.h>
diff --git a/tests/init.sh b/tests/init.sh
index 9e64137..e793dee 100644
--- a/tests/init.sh
+++ b/tests/init.sh
@@ -1,4 +1,29 @@
 #!/bin/sh
+#
+# Copyright (c) 2011-2015 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.
 
 ME_="${0##*/}"
 
diff --git a/tests/ioctl.c b/tests/ioctl.c
index f58fad9..bd3e37d 100644
--- a/tests/ioctl.c
+++ b/tests/ioctl.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/ip_mreq.c b/tests/ip_mreq.c
index 8ec159c..a83b878 100644
--- a/tests/ip_mreq.c
+++ b/tests/ip_mreq.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/ipc_msg.c b/tests/ipc_msg.c
index 42d4c66..e0c3c3c 100644
--- a/tests/ipc_msg.c
+++ b/tests/ipc_msg.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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 <stdio.h>
 #include <errno.h>
 #include <sys/msg.h>
diff --git a/tests/ipc_msgbuf.c b/tests/ipc_msgbuf.c
index 954aaf0..3e1b145 100644
--- a/tests/ipc_msgbuf.c
+++ b/tests/ipc_msgbuf.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/ipc_sem.c b/tests/ipc_sem.c
index 64450b8..59c48b2 100644
--- a/tests/ipc_sem.c
+++ b/tests/ipc_sem.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Andreas Schwab <schwab@suse.de>
+ * 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 <stdio.h>
 #include <errno.h>
 #include <sys/sem.h>
diff --git a/tests/ipc_shm.c b/tests/ipc_shm.c
index b5c9784..9f47711 100644
--- a/tests/ipc_shm.c
+++ b/tests/ipc_shm.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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 <stdio.h>
 #include <errno.h>
 #include <sys/shm.h>
diff --git a/tests/llseek.c b/tests/llseek.c
index 77dc471..343ab83 100644
--- a/tests/llseek.c
+++ b/tests/llseek.c
@@ -49,7 +49,7 @@
 	if (rc != -1 || EBADF != errno)
 		return 77;
 
-	printf("_llseek(-1, %Lu, %p, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
+	printf("_llseek(-1, %llu, %p, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
 	       offset, &result);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/lseek.c b/tests/lseek.c
index 5517e62..7d4bd35 100644
--- a/tests/lseek.c
+++ b/tests/lseek.c
@@ -53,7 +53,7 @@
 	if (rc != -1 || EBADF != errno)
 		return 77;
 
-	printf("lseek(-1, %Lu, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
+	printf("lseek(-1, %llu, SEEK_SET) = -1 EBADF (Bad file descriptor)\n",
 	       (unsigned long long) offset);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/lstatx.c b/tests/lstatx.c
index d2bd636..7166bb7 100644
--- a/tests/lstatx.c
+++ b/tests/lstatx.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #define TEST_SYSCALL_INVOKE(sample, pst) \
 	syscall(TEST_SYSCALL_NR, sample, pst)
 #define PRINT_SYSCALL_HEADER(sample) \
diff --git a/tests/match.awk b/tests/match.awk
index 39af47c..abfbae9 100644
--- a/tests/match.awk
+++ b/tests/match.awk
@@ -1,3 +1,30 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014-2015 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.
+
 # s[] is array of match strings
 # r[] is array of match patterns
 
diff --git a/tests/membarrier.c b/tests/membarrier.c
index d4c5c4c..f32d2ec 100644
--- a/tests/membarrier.c
+++ b/tests/membarrier.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/mlock2.c b/tests/mlock2.c
index fe662d2..de5f423 100644
--- a/tests/mlock2.c
+++ b/tests/mlock2.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/mmap.c b/tests/mmap.c
index 43fcdd8..9c6ee27 100644
--- a/tests/mmap.c
+++ b/tests/mmap.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/mmsg.c b/tests/mmsg.c
index fddd7d1..978fdec 100644
--- a/tests/mmsg.c
+++ b/tests/mmsg.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+ * Copyright (c) 2014-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/mq.c b/tests/mq.c
index c6251b6..bf47ef7 100644
--- a/tests/mq.c
+++ b/tests/mq.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/net-accept-connect.c b/tests/net-accept-connect.c
index c9bc8e4..74419fa 100644
--- a/tests/net-accept-connect.c
+++ b/tests/net-accept-connect.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2013-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <stddef.h>
 #include <string.h>
diff --git a/tests/net-yy-accept.awk b/tests/net-yy-accept.awk
index 1cf63b0..fed3e30 100644
--- a/tests/net-yy-accept.awk
+++ b/tests/net-yy-accept.awk
@@ -1,3 +1,31 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
   lines = 9
   fail = 0
diff --git a/tests/net-yy-connect.awk b/tests/net-yy-connect.awk
index 79e9ee0..f4dcf91 100644
--- a/tests/net-yy-connect.awk
+++ b/tests/net-yy-connect.awk
@@ -1,3 +1,31 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
   lines = 5
   fail = 0
diff --git a/tests/net-yy.test b/tests/net-yy.test
index 29224fd..8316cac 100755
--- a/tests/net-yy.test
+++ b/tests/net-yy.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check decoding of ip:port pairs associated with socket descriptors
+#
+# Copyright (c) 2014-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/netlink_inet_diag.c b/tests/netlink_inet_diag.c
index bacb938..7d1bc2b 100644
--- a/tests/netlink_inet_diag.c
+++ b/tests/netlink_inet_diag.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/tests/netlink_unix_diag.c b/tests/netlink_unix_diag.c
index 817bf01..b6e026e 100644
--- a/tests/netlink_unix_diag.c
+++ b/tests/netlink_unix_diag.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <stddef.h>
 #include <stdint.h>
diff --git a/tests/oldselect.c b/tests/oldselect.c
index 3204ef5..5f9d5aa 100644
--- a/tests/oldselect.c
+++ b/tests/oldselect.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/pc.c b/tests/pc.c
index 4f12701..7d64ae0 100644
--- a/tests/pc.c
+++ b/tests/pc.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/pc.test b/tests/pc.test
index 022dacc..cc55878 100755
--- a/tests/pc.test
+++ b/tests/pc.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check -i option.
+#
+# Copyright (c) 2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/personality.c b/tests/personality.c
new file mode 100644
index 0000000..7a279a1
--- /dev/null
+++ b/tests/personality.c
@@ -0,0 +1,118 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include <stdio.h>
+#include <sys/personality.h>
+
+int main(void)
+{
+	const unsigned int good_type = PER_BSD;
+	const char *good_type_str = "PER_BSD";
+
+	const unsigned int bad_type = 0x1f;
+	const char *bad_type_str = "0x1f /\\* PER_\\?\\?\\? \\*/";
+
+	const unsigned int good_flags =
+		SHORT_INODE | WHOLE_SECONDS | STICKY_TIMEOUTS;
+	const char *good_flags_str =
+		"SHORT_INODE\\|WHOLE_SECONDS\\|STICKY_TIMEOUTS";
+
+	const unsigned int bad_flags = 0x10000;
+	const char *bad_flags_str = "0x10000";
+
+	const unsigned int saved_pers = personality(0xffffffff);
+	printf("personality\\(0xffffffff\\) = %#x \\([^)]*\\)\n", saved_pers);
+
+	/* PER_LINUX */
+	personality(PER_LINUX);
+	printf("personality\\(PER_LINUX\\) = %#x \\([^)]*\\)\n", saved_pers);
+
+	personality(0xffffffff);
+	puts("personality\\(0xffffffff\\) = 0 \\(PER_LINUX\\)");
+
+	personality(good_flags);
+	printf("personality\\(PER_LINUX\\|%s\\) = 0 \\(PER_LINUX\\)\n",
+	       good_flags_str);
+
+	personality(bad_flags);
+	printf("personality\\(PER_LINUX\\|%s\\)"
+	       " = %#x \\(PER_LINUX\\|%s\\)\n",
+	       bad_flags_str, good_flags, good_flags_str);
+
+	personality(good_flags | bad_flags);
+	printf("personality\\(PER_LINUX\\|%s\\|%s\\)"
+	       " = %#x \\(PER_LINUX\\|%s\\)\n",
+	       good_flags_str, bad_flags_str, bad_flags, bad_flags_str);
+
+	/* another valid type */
+	personality(good_type);
+	printf("personality\\(%s\\) = %#x \\(PER_LINUX\\|%s\\|%s\\)\n",
+	       good_type_str, good_flags | bad_flags,
+	       good_flags_str, bad_flags_str);
+
+	personality(good_type | good_flags);
+	printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n",
+	       good_type_str, good_flags_str, good_type, good_type_str);
+
+	personality(good_type | bad_flags);
+	printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n",
+	       good_type_str, bad_flags_str, good_type | good_flags,
+	       good_type_str, good_flags_str);
+
+	personality(good_type | good_flags | bad_flags);
+	printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n",
+	       good_type_str, good_flags_str, bad_flags_str,
+	       good_type | bad_flags,
+	       good_type_str, bad_flags_str);
+
+	/* invalid type */
+	personality(bad_type);
+	printf("personality\\(%s\\) = %#x \\(%s\\|%s\\|%s\\)\n",
+	       bad_type_str, good_type | good_flags | bad_flags,
+	       good_type_str, good_flags_str, bad_flags_str);
+
+	personality(bad_type | good_flags);
+	printf("personality\\(%s\\|%s\\) = %#x \\(%s\\)\n",
+	       bad_type_str, good_flags_str, bad_type, bad_type_str);
+
+	personality(bad_type | bad_flags);
+	printf("personality\\(%s\\|%s\\) = %#x \\(%s\\|%s\\)\n",
+	       bad_type_str, bad_flags_str, bad_type | good_flags,
+	       bad_type_str, good_flags_str);
+
+	personality(bad_type | good_flags | bad_flags);
+	printf("personality\\(%s\\|%s\\|%s\\) = %#x \\(%s\\|%s\\)\n",
+	       bad_type_str, good_flags_str, bad_flags_str,
+	       bad_type | bad_flags, bad_type_str, bad_flags_str);
+
+	personality(saved_pers);
+	printf("personality\\([^)]*\\) = %#x \\(%s\\|%s\\|%s\\)\n",
+	       bad_type | good_flags | bad_flags,
+	       bad_type_str, good_flags_str, bad_flags_str);
+
+	return 0;
+}
diff --git a/tests/personality.test b/tests/personality.test
new file mode 100755
index 0000000..e3d6e67
--- /dev/null
+++ b/tests/personality.test
@@ -0,0 +1,13 @@
+#!/bin/sh
+
+# Check personality syscall decoding.
+
+. "${srcdir=.}/init.sh"
+
+run_prog > /dev/null
+OUT="$LOG.out"
+run_strace -a20 -epersonality $args > "$OUT"
+match_grep "$LOG" "$OUT"
+rm -f "$OUT"
+
+exit 0
diff --git a/tests/pipe.c b/tests/pipe.c
index 6a5306f..3f740a0 100644
--- a/tests/pipe.c
+++ b/tests/pipe.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/ppoll.c b/tests/ppoll.c
index f99b722..2b9194b 100644
--- a/tests/ppoll.c
+++ b/tests/ppoll.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/pselect6.c b/tests/pselect6.c
index 34af19e..142e8be 100644
--- a/tests/pselect6.c
+++ b/tests/pselect6.c
@@ -96,8 +96,8 @@
 	FD_SET(fds[1], set[1]);
 	if (syscall(__NR_pselect6, fds[1] + 1, NULL, set[1], NULL, &tm.ts, NULL) != 3)
 		return 77;
-	printf("pselect6(%d, NULL, [1 2 %d %d], NULL, {%Ld, %Ld}, NULL)"
-	       " = 3 (out [1 2 %d], left {%Ld, %Ld})\n",
+	printf("pselect6(%d, NULL, [1 2 %d %d], NULL, {%lld, %lld}, NULL)"
+	       " = 3 (out [1 2 %d], left {%lld, %lld})\n",
 	       fds[1] + 1, fds[0], fds[1],
 	       (long long) tm_in.ts.tv_sec, (long long) tm_in.ts.tv_nsec,
 	       fds[1],
diff --git a/tests/readlink.c b/tests/readlink.c
index 0d9c15f..d1390f2 100644
--- a/tests/readlink.c
+++ b/tests/readlink.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/readlinkat.c b/tests/readlinkat.c
index 758dd0f..76d0efd 100644
--- a/tests/readlinkat.c
+++ b/tests/readlinkat.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Gleb Fotengauer-Malinovskiy <glebfm@altlinux.org>
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/restart_syscall.c b/tests/restart_syscall.c
index 9de8625..3989a84 100644
--- a/tests/restart_syscall.c
+++ b/tests/restart_syscall.c
@@ -64,8 +64,15 @@
 	       (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec,
 	       (intmax_t) rem.tv_sec, (intmax_t) rem.tv_nsec);
 	puts("--- SIGALRM \\{si_signo=SIGALRM, si_code=SI_KERNEL\\} ---");
-	printf("(nanosleep\\(\\{%jd, %jd\\}, %p|restart_syscall\\(<\\.\\.\\."
+#ifdef __arm__
+/* old kernels used to overwrite ARM_r0 with -EINTR */
+# define ALTERNATIVE_NANOSLEEP_REQ "0xfffffffc|"
+#else
+# define ALTERNATIVE_NANOSLEEP_REQ ""
+#endif
+	printf("(nanosleep\\((%s\\{%jd, %jd\\}), %p|restart_syscall\\(<\\.\\.\\."
 	       " resuming interrupted nanosleep \\.\\.\\.>)\\) = 0\n",
+	       ALTERNATIVE_NANOSLEEP_REQ,
 	       (intmax_t) req.tv_sec, (intmax_t) req.tv_nsec, &rem);
 
 	puts("\\+\\+\\+ exited with 0 \\+\\+\\+");
diff --git a/tests/rt_sigqueueinfo.c b/tests/rt_sigqueueinfo.c
index ab00da8..be277a4 100644
--- a/tests/rt_sigqueueinfo.c
+++ b/tests/rt_sigqueueinfo.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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 <stdio.h>
 #include <signal.h>
 #include <unistd.h>
diff --git a/tests/sched_xetattr.c b/tests/sched_xetattr.c
index 9a30eff..4b060ce 100644
--- a/tests/sched_xetattr.c
+++ b/tests/sched_xetattr.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/scm_rights-fd.test b/tests/scm_rights-fd.test
index 62e7c0d..a32ef36 100755
--- a/tests/scm_rights-fd.test
+++ b/tests/scm_rights-fd.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check how SCM_RIGHTS and SCM_CREDENTIALS control messages are decoded in -y mode.
+#
+# Copyright (c) 2014-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/scm_rights.c b/tests/scm_rights.c
index 0f25e01..c41444f 100644
--- a/tests/scm_rights.c
+++ b/tests/scm_rights.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <string.h>
 #include <stdlib.h>
diff --git a/tests/seccomp.c b/tests/seccomp.c
index 01fe2eb..77d6980 100644
--- a/tests/seccomp.c
+++ b/tests/seccomp.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/set_ptracer_any.c b/tests/set_ptracer_any.c
index dbd5337..51a2675 100644
--- a/tests/set_ptracer_any.c
+++ b/tests/set_ptracer_any.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2013-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/sigaction.awk b/tests/sigaction.awk
index df96e4b..5c6b6d0 100644
--- a/tests/sigaction.awk
+++ b/tests/sigaction.awk
@@ -1,3 +1,30 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
 	n1[1] = "SIG_IGN, \\[HUP INT\\], SA_RESTORER\\|SA_RESTART, 0x[0-9a-f]+"
 	n2[1] = "SIG_IGN, \\[HUP INT\\], SA_RESTART"
diff --git a/tests/sigaction.c b/tests/sigaction.c
index b5f19b5..1c034ff 100644
--- a/tests/sigaction.c
+++ b/tests/sigaction.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <stdlib.h>
 #include <unistd.h>
diff --git a/tests/signalfd.c b/tests/signalfd.c
index 1b6cd0c..5db3018 100644
--- a/tests/signalfd.c
+++ b/tests/signalfd.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/sigreturn.c b/tests/sigreturn.c
index a84f65e..ab21fc2 100644
--- a/tests/sigreturn.c
+++ b/tests/sigreturn.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/sigreturn.test b/tests/sigreturn.test
index 8cf636a..bc8dcbd 100755
--- a/tests/sigreturn.test
+++ b/tests/sigreturn.test
@@ -1,6 +1,31 @@
 #!/bin/sh
-
+#
 # Check rt_sigprocmask and sigreturn/rt_sigreturn decoding.
+#
+# Copyright (c) 2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/strace-k.test b/tests/strace-k.test
index 458d58b..1cc6302 100755
--- a/tests/strace-k.test
+++ b/tests/strace-k.test
@@ -1,6 +1,32 @@
 #!/bin/sh
-
+#
 # Ensure that strace -k works.
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/sysinfo.c b/tests/sysinfo.c
index 4ca0ec7..0188002 100644
--- a/tests/sysinfo.c
+++ b/tests/sysinfo.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * 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 <stdio.h>
 #include <sys/sysinfo.h>
 
diff --git a/tests/time.c b/tests/time.c
index 7a9d353..975ba09 100644
--- a/tests/time.c
+++ b/tests/time.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/times.c b/tests/times.c
index f0e7086..ffe8aae 100644
--- a/tests/times.c
+++ b/tests/times.c
@@ -1,3 +1,31 @@
+/*
+ * Copyright (c) 2015 Eugene Syromyatnikov <evgsyr@gmail.com>
+ * Copyright (c) 2015 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.
+ */
+
 /**
  * @file
  * This test burns some CPU cycles in user space and kernel space in order to
@@ -69,9 +97,29 @@
 	 * prefer direct times syscall over libc's times function because
 	 * the latter is more prone to return value truncation.
 	 */
-#if !defined __NR_times \
- || defined LINUX_MIPSN32 \
- || defined __x86_64__ && defined __ILP32__
+#undef USE_LIBC_SYSCALL
+#if defined __NR_times && \
+   !defined(LINUX_MIPSN32) && \
+   !(defined __x86_64__ && defined __ILP32__)
+# define USE_LIBC_SYSCALL 1
+#endif
+
+#if defined USE_LIBC_SYSCALL
+	long res = syscall(__NR_times, &tbuf);
+
+	if (-1L == res)
+		return 77;
+	else
+		llres = (unsigned long) res;
+#elif defined __NR_times && defined __x86_64__ && defined __ILP32__
+	register long arg asm("rdi") = (long) &tbuf;
+	asm volatile("syscall\n\t"
+		     : "=a"(llres)
+		     : "0"(__NR_times), "r"(arg)
+		     : "memory", "cc", "r11", "cx");
+	if (llres > 0xfffffffffffff000)
+		return 77;
+#else
 	clock_t res = times(&tbuf);
 
 	if ((clock_t) -1 == res)
@@ -80,13 +128,6 @@
 		llres = (unsigned long) res;
 	else
 		llres = res;
-#else
-	long res = syscall(__NR_times, &tbuf);
-
-	if (-1L == res)
-		return 77;
-	else
-		llres = (unsigned long) res;
 #endif
 
 	printf("times({tms_utime=%llu, tms_stime=%llu, ",
diff --git a/tests/truncate.c b/tests/truncate.c
index 35c647d..0e76aa7 100644
--- a/tests/truncate.c
+++ b/tests/truncate.c
@@ -55,7 +55,7 @@
 	if (rc != -1 || ENOENT != errno)
 		return 77;
 
-	printf("truncate(\"%s\", %Lu) = -1 ENOENT (No such file or directory)\n",
+	printf("truncate(\"%s\", %llu) = -1 ENOENT (No such file or directory)\n",
 	       qname, (unsigned long long) len);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/truncate64.c b/tests/truncate64.c
index 8256580..a617c69 100644
--- a/tests/truncate64.c
+++ b/tests/truncate64.c
@@ -48,7 +48,7 @@
 	if (rc != -1 || ENOENT != errno)
 		return 77;
 
-	printf("truncate64(\"%s\", %Lu) = -1 ENOENT (No such file or directory)\n",
+	printf("truncate64(\"%s\", %llu) = -1 ENOENT (No such file or directory)\n",
 	       qname, (unsigned long long) len);
 
 	puts("+++ exited with 0 +++");
diff --git a/tests/uid.awk b/tests/uid.awk
index b79aa79..a56c5be 100644
--- a/tests/uid.awk
+++ b/tests/uid.awk
@@ -1,3 +1,30 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
   r_uint = "(0|[1-9][0-9]*)"
   regexp = "^getx?uid" suffix "\\(\\)[[:space:]]+= " r_uint "$"
diff --git a/tests/uid.c b/tests/uid.c
index bf4d8d2..3a502ba 100644
--- a/tests/uid.c
+++ b/tests/uid.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/uid16.c b/tests/uid16.c
index c0ef120..41729e8 100644
--- a/tests/uid16.c
+++ b/tests/uid16.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/uid32.c b/tests/uid32.c
index 472461f..878a48c 100644
--- a/tests/uid32.c
+++ b/tests/uid32.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/uio.c b/tests/uio.c
index fc5eae3..4a34a7b 100644
--- a/tests/uio.c
+++ b/tests/uio.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2014-2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/umount.c b/tests/umount.c
index 380417d..612767f 100644
--- a/tests/umount.c
+++ b/tests/umount.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <errno.h>
 #include <stdio.h>
 #include <unistd.h>
diff --git a/tests/umount2.c b/tests/umount2.c
index 141e383..bb41596 100644
--- a/tests/umount2.c
+++ b/tests/umount2.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <stdio.h>
 #include <unistd.h>
 #include <sys/stat.h>
diff --git a/tests/umovestr.c b/tests/umovestr.c
index 9ad6b94..dac2ead 100644
--- a/tests/umovestr.c
+++ b/tests/umovestr.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <string.h>
 #include <unistd.h>
 #include <sys/mman.h>
diff --git a/tests/umovestr2.c b/tests/umovestr2.c
index c7bd42f..5a78fdc 100644
--- a/tests/umovestr2.c
+++ b/tests/umovestr2.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <stdio.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/tests/unix-pair-send-recv.c b/tests/unix-pair-send-recv.c
index 535f8e7..c0623c1 100644
--- a/tests/unix-pair-send-recv.c
+++ b/tests/unix-pair-send-recv.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <assert.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/tests/unix-yy-accept.awk b/tests/unix-yy-accept.awk
index 4f34f51..4ed60e4 100644
--- a/tests/unix-yy-accept.awk
+++ b/tests/unix-yy-accept.awk
@@ -1,3 +1,31 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
   lines = 8
   fail = 0
diff --git a/tests/unix-yy-connect.awk b/tests/unix-yy-connect.awk
index 27cb76a..262bf2e 100644
--- a/tests/unix-yy-connect.awk
+++ b/tests/unix-yy-connect.awk
@@ -1,3 +1,31 @@
+#!/bin/gawk
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
+
 BEGIN {
   lines = 6
   fail = 0
diff --git a/tests/unix-yy.test b/tests/unix-yy.test
index 3205c74..84ee89d 100755
--- a/tests/unix-yy.test
+++ b/tests/unix-yy.test
@@ -1,7 +1,33 @@
 #!/bin/sh
-
+#
 # Check decoding of address information (inode[->peer][,path])
 # associated with unix domain socket descriptors.
+#
+# Copyright (c) 2014 Masatake YAMATO <yamato@redhat.com>
+# Copyright (c) 2014-2015 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.
 
 . "${srcdir=.}/init.sh"
 
diff --git a/tests/userfaultfd.c b/tests/userfaultfd.c
index 2dcf31c..6f030dd 100644
--- a/tests/userfaultfd.c
+++ b/tests/userfaultfd.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/utime.c b/tests/utime.c
index c1af785..89c5b8a 100644
--- a/tests/utime.c
+++ b/tests/utime.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include <time.h>
 #include <utime.h>
 #include <errno.h>
diff --git a/tests/utimensat.c b/tests/utimensat.c
index 00b9636..26de9eb 100644
--- a/tests/utimensat.c
+++ b/tests/utimensat.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/vfork-f.c b/tests/vfork-f.c
new file mode 100644
index 0000000..6a7cce4
--- /dev/null
+++ b/tests/vfork-f.c
@@ -0,0 +1,106 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
+#ifdef HAVE_CONFIG_H
+# include "config.h"
+#endif
+
+#include <fcntl.h>
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/wait.h>
+
+static inline int
+logit(const char *const str)
+{
+	return pwrite(-1, str, strlen(str), 0) >= 0;
+}
+
+int main(int ac, char **av, char **ep)
+{
+	if (ac < 1)
+		return 1;
+	if (ac > 1) {
+		if (read(0, &ac, sizeof(int)))
+			return 2;
+		return logit(av[1]);
+	}
+
+	logit("start");
+
+	int fds[2];
+	(void) close(0);
+	if (pipe(fds)) {
+		perror("pipe");
+		return 77;
+	}
+	if (fcntl(fds[1], F_SETFD, FD_CLOEXEC)) {
+		perror("fcntl");
+		return 77;
+	}
+
+	char *const args[] = { av[0], (char *) "exec", NULL };
+	pid_t pid = vfork();
+
+	if (pid < 0) {
+		perror("vfork");
+		return 77;
+	}
+
+	if (!pid) {
+		if (logit("child") || execve(args[0], args, args + 1))
+			_exit(2);
+	}
+
+	close(0);
+
+	logit("parent");
+	close(fds[1]);
+
+	int status;
+	if (wait(&status) != pid) {
+		perror("wait");
+		return 77;
+	}
+	if (status) {
+		fprintf(stderr, "status = %d\n", status);
+		return 77;
+	}
+
+	logit("finish");
+
+	pid_t ppid = getpid();
+	close(-1);
+	printf("%-5d pwrite64(-1, \"start\", 5, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"child\", 5, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"parent\", 6, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"exec\", 4, 0) = -1 EBADF (%m)\n"
+	       "%-5d pwrite64(-1, \"finish\", 6, 0) = -1 EBADF (%m)\n",
+	       ppid, pid, ppid, pid, ppid);
+	return 0;
+}
diff --git a/tests/vfork-f.test b/tests/vfork-f.test
new file mode 100755
index 0000000..ff4422b
--- /dev/null
+++ b/tests/vfork-f.test
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# Check how strace -f follows vfork syscall.
+
+. "${srcdir=.}/fork-f.test"
diff --git a/tests/wait.c b/tests/wait.c
index 6f27d9c..a1fc0a8 100644
--- a/tests/wait.c
+++ b/tests/wait.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/xattr.c b/tests/xattr.c
index 073fd51..e7616f3 100644
--- a/tests/xattr.c
+++ b/tests/xattr.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/xet_robust_list.c b/tests/xet_robust_list.c
index fbe903a..de598c8 100644
--- a/tests/xet_robust_list.c
+++ b/tests/xet_robust_list.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 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.
+ */
+
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
diff --git a/tests/xselect.c b/tests/xselect.c
index 916204e..fe33873 100644
--- a/tests/xselect.c
+++ b/tests/xselect.c
@@ -80,8 +80,8 @@
 	FD_SET(fds[1], set);
 	if (syscall(TEST_SYSCALL_NR, fds[1] + 1, NULL, set, NULL, &tm.tv) != 3)
 		return 77;
-	printf("%s(%d, NULL, [1 2 %d %d], NULL, {%Ld, %Ld})"
-	       " = 3 (out [1 2 %d], left {%Ld, %Ld})\n",
+	printf("%s(%d, NULL, [1 2 %d %d], NULL, {%lld, %lld})"
+	       " = 3 (out [1 2 %d], left {%lld, %lld})\n",
 	       TEST_SYSCALL_STR, fds[1] + 1, fds[0], fds[1],
 	       (long long) tm_in.tv.tv_sec, (long long) tm_in.tv.tv_usec,
 	       fds[1],
diff --git a/tests/xstatx.c b/tests/xstatx.c
index 471f22e..7840190 100644
--- a/tests/xstatx.c
+++ b/tests/xstatx.c
@@ -163,7 +163,7 @@
 	printf("{st_dev=makedev(%u, %u)",
 	       (unsigned int) major(st->st_dev),
 	       (unsigned int) minor(st->st_dev));
-	printf(", st_ino=%Lu", (unsigned long long) st->st_ino);
+	printf(", st_ino=%llu", (unsigned long long) st->st_ino);
 	printf(", st_mode=");
 	print_ftype(st->st_mode);
 	printf("|");
@@ -181,7 +181,7 @@
 		       (unsigned int) minor(st->st_rdev));
 		break;
 	default:
-		printf(", st_size=%Lu", (unsigned long long) st->st_size);
+		printf(", st_size=%llu", (unsigned long long) st->st_size);
 	}
 
 	printf(", st_atime=");
@@ -254,7 +254,7 @@
 	if ((unsigned long long) SAMPLE_SIZE !=
 	    (unsigned long long) st[0].st_size) {
 		fprintf(stderr, "Size mismatch: "
-				"requested size(%Lu) != st_size(%Lu)\n",
+				"requested size(%llu) != st_size(%llu)\n",
 			(unsigned long long) SAMPLE_SIZE,
 			(unsigned long long) st[0].st_size);
 		fprintf(stderr, "The most likely reason for this is incorrect"
diff --git a/times.c b/times.c
index be23950..d3f6daf 100644
--- a/times.c
+++ b/times.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012 H.J. Lu <hongjiu.lu@intel.com>
+ * Copyright (c) 2015 Elvira Khabirova <lineprinter0@gmail.com>
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include DEF_MPERS_TYPE(tms_t)
 #include <sys/times.h>
@@ -12,10 +45,10 @@
 		return 0;
 
 	if (!umove_or_printaddr(tcp, tcp->u_arg[0], &tbuf)) {
-		tprintf("{tms_utime=%Lu, tms_stime=%Lu, ",
+		tprintf("{tms_utime=%llu, tms_stime=%llu, ",
 			(unsigned long long) tbuf.tms_utime,
 			(unsigned long long) tbuf.tms_stime);
-		tprintf("tms_cutime=%Lu, tms_cstime=%Lu}",
+		tprintf("tms_cutime=%llu, tms_cstime=%llu}",
 			(unsigned long long) tbuf.tms_cutime,
 			(unsigned long long) tbuf.tms_cstime);
 	}
diff --git a/uid.c b/uid.c
index 30244ab..c872392 100644
--- a/uid.c
+++ b/uid.c
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2003-2015 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.
+ */
+
 #ifdef STRACE_UID_SIZE
 # if STRACE_UID_SIZE != 16
 #  error invalid STRACE_UID_SIZE
@@ -39,18 +70,15 @@
 
 SYS_FUNC(getuid)
 {
-	if (exiting(tcp))
-		tcp->u_rval = (uid_t) tcp->u_rval;
-	return RVAL_UDECIMAL;
+	return RVAL_UDECIMAL | RVAL_DECODED;
 }
 
 SYS_FUNC(setfsuid)
 {
 	if (entering(tcp))
 		tprintf("%u", (uid_t) tcp->u_arg[0]);
-	else
-		tcp->u_rval = (uid_t) tcp->u_rval;
-	return RVAL_UDECIMAL;
+
+	return RVAL_UDECIMAL | RVAL_DECODED;
 }
 
 SYS_FUNC(setuid)
diff --git a/uname.c b/uname.c
index 8990e38..3df11e8 100644
--- a/uname.c
+++ b/uname.c
@@ -1,3 +1,34 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2012-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <sys/utsname.h>
diff --git a/userfaultfd.c b/userfaultfd.c
index 7f8e3e4..15f825a 100644
--- a/userfaultfd.c
+++ b/userfaultfd.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 #include <fcntl.h>
 
diff --git a/utimes.c b/utimes.c
index 31d6508..2908529 100644
--- a/utimes.c
+++ b/utimes.c
@@ -1,3 +1,36 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2006-2007 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2006 Bernhard Kaindl <bk@suse.de>
+ * Copyright (c) 2006-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 SYS_FUNC(utimes)
diff --git a/wait.c b/wait.c
index 2e495db..156292f 100644
--- a/wait.c
+++ b/wait.c
@@ -1,3 +1,37 @@
+/*
+ * Copyright (c) 1991, 1992 Paul Kranenburg <pk@cs.few.eur.nl>
+ * Copyright (c) 1993 Branko Lankester <branko@hacktic.nl>
+ * Copyright (c) 1993-1996 Rick Sladkey <jrs@world.std.com>
+ * Copyright (c) 1996-1999 Wichert Akkerman <wichert@cistron.nl>
+ * Copyright (c) 2002-2004 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2009-2013 Denys Vlasenko <dvlasenk@redhat.com>
+ * Copyright (c) 2014-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #include <sys/wait.h>
diff --git a/xattr.c b/xattr.c
index 0f8533e..c47ebd6 100644
--- a/xattr.c
+++ b/xattr.c
@@ -1,3 +1,32 @@
+/*
+ * Copyright (c) 2002-2005 Roland McGrath <roland@redhat.com>
+ * Copyright (c) 2004 Ulrich Drepper <drepper@redhat.com>
+ * Copyright (c) 2005-2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 #ifdef HAVE_SYS_XATTR_H
diff --git a/xlat/gen.sh b/xlat/gen.sh
index 0f1adad..6fbade9 100755
--- a/xlat/gen.sh
+++ b/xlat/gen.sh
@@ -1,4 +1,30 @@
 #!/bin/sh
+#
+# Copyright (c) 2014-2015 Mike Frysinger <vapier@gentoo.org>
+# Copyright (c) 2014-2015 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.
 
 usage()
 {
diff --git a/xlat/personality_flags.in b/xlat/personality_flags.in
new file mode 100644
index 0000000..a8715e2
--- /dev/null
+++ b/xlat/personality_flags.in
@@ -0,0 +1,12 @@
+#unconditional
+UNAME26
+ADDR_NO_RANDOMIZE
+FDPIC_FUNCPTRS
+MMAP_PAGE_ZERO
+ADDR_COMPAT_LAYOUT
+READ_IMPLIES_EXEC
+ADDR_LIMIT_32BIT
+SHORT_INODE
+WHOLE_SECONDS
+STICKY_TIMEOUTS
+ADDR_LIMIT_3GB
diff --git a/xlat/personality_options.in b/xlat/personality_types.in
similarity index 100%
rename from xlat/personality_options.in
rename to xlat/personality_types.in
diff --git a/xmalloc.c b/xmalloc.c
index c852f55..1158927 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -1,3 +1,30 @@
+/*
+ * Copyright (c) 2015 Dmitry V. Levin <ldv@altlinux.org>
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ * 3. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
+ * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+ * IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
+ * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
+ * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
 #include "defs.h"
 
 void die_out_of_memory(void)