diff options
author | Elliott Hughes <enh@google.com> | 2016-01-04 10:01:35 -0800 |
---|---|---|
committer | Elliott Hughes <enh@google.com> | 2016-01-04 10:01:35 -0800 |
commit | 06ebf8d19e5fcfaaaf150b986278c7dcc689ba07 (patch) | |
tree | 1a37e9f43595796f6a235bf768e33ca4b942c05f | |
parent | dbe82fba03fa40209293f104a2f67979c6bc9e57 (diff) | |
parent | f32126ba790dd4e61d43a2140b24f02426297bb6 (diff) | |
download | strace-06ebf8d19e5fcfaaaf150b986278c7dcc689ba07.tar.gz |
Merge remote-tracking branch 'strace/master' into HEAD
222 files changed, 5171 insertions, 365 deletions
@@ -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 a98f7208..b1aba3b3 100644 --- a/.travis.yml +++ b/.travis.yml @@ -10,7 +10,6 @@ addons: apt: packages: - gcc-multilib - - libacl1-dev env: global: diff --git a/Makefile.am b/Makefile.am index 89cf2df9..d43608d9 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 @@ strace_SOURCES = \ chmod.c \ clone.c \ count.c \ + defs.h \ desc.c \ dirent.c \ dirent64.c \ @@ -68,6 +97,7 @@ strace_SOURCES = \ flock.c \ flock.h \ futex.c \ + gcc_compat.h \ get_robust_list.c \ getcpu.c \ getcwd.c \ @@ -183,7 +213,6 @@ strace_LDFLAGS += $(libunwind_LDFLAGS) strace_LDADD += $(libunwind_LIBS) endif -noinst_HEADERS = defs.h # Enable this to get link map generated #strace_CFLAGS = $(AM_CFLAGS) -Wl,-Map=strace.mapfile @@ -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) =============================================== @@ -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 e4b704c8..aa8bc86f 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 6b698acc..421649d5 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> */ @@ -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 db704cc2..1524b9b6 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 @@ AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, [#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 74392ed7..e8b3e3bc 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 @@ strace (4.10-1) experimental; urgency=low + 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 @@ strace (3.1-11) unstable; urgency=low * 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 5c67fea1..c762be15 100644 --- a/debian/control +++ b/debian/control @@ -2,8 +2,8 @@ Source: strace 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 912b4103..a9ba147b 100755 --- a/debian/rules +++ b/debian/rules @@ -62,7 +62,7 @@ build64/Makefile: 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 @@ -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 @@ const char *strerror(int); 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 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int); /* a refers to the lower numbered u_arg, * b refers to the higher numbered u_arg */ -#ifdef HAVE_LITTLE_ENDIAN_LONG_LONG +#ifdef WORDS_BIGENDIAN # define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))) + ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))) #else # define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))) + ((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 @@ extern unsigned num_quals; #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) @@ -270,7 +270,7 @@ SYS_FUNC(pselect6) /* 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]); } } @@ -47,7 +47,7 @@ print_old_dirent(struct tcb *tcp, long addr) 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 @@ SYS_FUNC(getdents) 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); @@ -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 @@ -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 @@ -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 @@ -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> @@ -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" @@ -46,7 +46,7 @@ print_struct_flock64(const struct_kernel_flock64 *fl, const int getlk) 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 e32366ad..dbaf83a7 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) @@ -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 @@ -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 00000000..1f2c8354 --- /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 23d978f5..1977023a 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) @@ -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> @@ -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 { @@ -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 c8b6a044..3dee7618 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 @@ -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" @@ -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; @@ -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 @@ -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 5f997e72..6aaa0255 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 ec75d3cb..64cc86f8 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 78b74708..8e18a71c 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 ddf3dae9..d4928d4b 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 fd6e1dae..026c1cf7 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 5847dc48..11000083 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 d9b6ffc5..23a167c8 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 5538dfed..0a24caed 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 626b08cf..e4c11fcf 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 c30e7318..f3387045 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 f6b75495..104dbb59 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 20ba789f..db89215d 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 09dfdef6..52daa7f4 100644 --- a/linux/ia64/get_error.c +++ b/linux/ia64/get_error.c @@ -10,7 +10,7 @@ get_error(struct tcb *tcp, const bool check_errno) 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 3bfa3479..c703aa19 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 c3ce07df..d6e0bf40 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 0336a563..7341e13b 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 e58055e1..42a282b4 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 f97511da..85e8c788 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 9f320380..7341abc9 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 ab1f6c57..79c2cee7 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 52c05ad9..1c91c0ac 100644 --- a/linux/nios2/get_error.c +++ b/linux/nios2/get_error.c @@ -8,7 +8,7 @@ get_error(struct tcb *tcp, const bool check_errno) * 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 8a4b70ea..01efe3a2 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 ed84b3be..351fe250 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 41506fb7..8f10612d 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 741be444..a0d97303 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 81152afb..0bf55ea3 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 ad2827a9..96097d4e 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 a43526d0..9f110184 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 4715d271..d3ece3ff 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 614ba81e..df6b1b95 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 fa57ed09..1b960ace 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 a41f732b..256cacee 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 bacd04fb..8f8978b6 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 3b70b6dd..c5ead536 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 c86f0597..28dbab4d 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 ecd2ccee..b3b4814b 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 8b163de5..af3329a1 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 0ad340fc..9f7c2489 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 1fd47e05..18f00ec5 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 9f936f00..5f07c2f5 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 c6482b33..c95e5939 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) @@ -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 e6d22f0c..00000000 --- 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 70933ffa..1fe8a8e8 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 783a7083..485c62a5 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 fcd370f8..7c140772 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" @@ -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 @@ SYS_FUNC(mknodat) 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 */ @@ -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 */ @@ -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 @@ function compare_indices(i1, v1, i2, v2) { 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 @@ function what_is(what_idx, type_idx, special, item, \ 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 @@ BEGIN { } } /^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 @@ END { 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 } } @@ -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 @@ ARCH_FLAG=$1 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 e788446c..72b5f5da 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 @@ mkdir -p "$mpers_dir" 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 fe606e87..adbefd57 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) @@ -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 458d6d41..a5755c66 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 d530ec25..e72cdf71 100644 --- a/pathtrace.c +++ b/pathtrace.c @@ -216,6 +216,7 @@ pathtrace_match(struct tcb *tcp) 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]); @@ -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 5c425c61..44ed5e3b 100644 --- a/personality.c +++ b/personality.c @@ -1,12 +1,69 @@ -#include "defs.h" +/* + * 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; + + 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; - return RVAL_DECODED; + 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; } @@ -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 4d387669..dddb3f16 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 a7219361..8ff05fcf 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 fac7a441..4083e19a 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 0908355f..c7e1bb22 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 24934d45..82e1e16a 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) @@ -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> @@ -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> @@ -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 @@ -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 cd02794d..b3e43578 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) @@ -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 93f5f16e..f0faf8ce 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> @@ -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 8165d0d7..1f14eb7c 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 @@ make -k check VERBOSE=1 %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 4f6cbed8..8e6afa0f 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> @@ -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 @@ static const struct_sysent sysent2[] = { /* Now undef them since short defines cause wicked namespace pollution. */ #undef SEN -#undef SEN_NAME #undef TD #undef TF #undef TI @@ -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> @@ -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> @@ -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 { @@ -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 fba8c9d4..34d37bf3 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 @@ sigkill_rain skodic threaded_execve ubi -vfork wait_must_be_interruptible x32_lseek x32_mmap diff --git a/test/Makefile b/test/Makefile index dbc5008b..ad727fcb 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 6cc56cc2..1891eeec 100644 --- a/tests/.gitignore +++ b/tests/.gitignore @@ -21,6 +21,7 @@ fcntl fcntl64 file_handle filter-unavailable +fork-f fstat fstat64 fstatat64 @@ -38,6 +39,7 @@ ipc_msgbuf ipc_sem ipc_shm ksysent +ksysent.h llseek lseek lstat @@ -56,6 +58,7 @@ netlink_unix_diag newfstatat oldselect pc +personality pipe ppoll pselect6 @@ -100,6 +103,7 @@ unix-pair-send-recv userfaultfd utime utimensat +vfork-f wait xattr xet_robust_list diff --git a/tests/Makefile.am b/tests/Makefile.am index fdeb5ec7..6c8f07c9 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 @@ check_PROGRAMS = \ fcntl64 \ file_handle \ filter-unavailable \ + fork-f \ fstat \ fstat64 \ fstatat64 \ @@ -66,6 +92,7 @@ check_PROGRAMS = \ newfstatat \ oldselect \ pc \ + personality \ pipe \ ppoll \ pselect6 \ @@ -110,6 +137,7 @@ check_PROGRAMS = \ userfaultfd \ utime \ utimensat \ + vfork-f \ wait \ xattr \ xet_robust_list \ @@ -158,6 +186,7 @@ TESTS = \ fcntl64.test \ file_handle.test \ filter-unavailable.test \ + fork-f.test \ fstat.test \ fstat64.test \ fstatat64.test \ @@ -191,6 +220,7 @@ TESTS = \ newfstatat.test \ oldselect.test \ pc.test \ + personality.test \ pipe.test \ ppoll.test \ pselect6.test \ @@ -233,6 +263,7 @@ TESTS = \ 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 08974e1b..e3a073a2 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 2706481e..f1ab04f1 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 636fae88..daa4e74b 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 f2f143d6..bad8b0f3 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 918d6a8e..c00e3d4f 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 9c53fe24..60d2c73a 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 595a505b..b77dc51c 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 345d7d0a..546c21d9 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 1c11c101..ca4d4e95 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 4e4c4220..66bcf9eb 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 046dd1a2..5de0c221 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 69f6f5fe..09599780 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 4363c946..7d7257dd 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 6f865e69..2151c9a8 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 00000000..a1a45b9e --- /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 00000000..8fdf062e --- /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 cc5e3def..5c08a787 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 04bb3a6f..ef17a792 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 1f21f633..d10a90d8 100644 --- a/tests/ftruncate.c +++ b/tests/ftruncate.c @@ -53,7 +53,7 @@ main(void) 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 7dfbf6b4..ee865b13 100644 --- a/tests/ftruncate64.c +++ b/tests/ftruncate64.c @@ -46,7 +46,7 @@ main(void) 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 cfa69c23..6df32024 100644 --- a/tests/getdents.c +++ b/tests/getdents.c @@ -83,7 +83,7 @@ print_dirent(const kernel_dirent *d) 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 7cd079ff..87387ed3 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 9e64137b..e793deea 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 f58fad96..bd3e37d0 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 8ec159c5..a83b8787 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 42d4c66d..e0c3c3c5 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 954aaf0f..3e1b1457 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 64450b89..59c48b29 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 b5c9784b..9f477116 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 77dc4713..343ab83e 100644 --- a/tests/llseek.c +++ b/tests/llseek.c @@ -49,7 +49,7 @@ main(void) 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 5517e625..7d4bd35c 100644 --- a/tests/lseek.c +++ b/tests/lseek.c @@ -53,7 +53,7 @@ main(void) 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 d2bd636c..7166bb76 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 39af47ce..abfbae92 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 d4c5c4ca..f32d2ec2 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 fe662d20..de5f423d 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 43fcdd8a..9c6ee27b 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 fddd7d15..978fdec2 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 @@ -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 c9bc8e4d..74419fac 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 1cf63b04..fed3e30d 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 79e9ee08..f4dcf913 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 29224fd4..8316cacf 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 bacb938c..7d1bc2bd 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 817bf01e..b6e026e3 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 3204ef53..5f9d5aaa 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 @@ -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 022daccf..cc558786 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 00000000..7a279a14 --- /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 00000000..e3d6e671 --- /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 6a5306f3..3f740a04 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 f99b7228..2b9194b9 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 34af19e0..142e8bea 100644 --- a/tests/pselect6.c +++ b/tests/pselect6.c @@ -96,8 +96,8 @@ int main(int ac, char **av) 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 0d9c15f7..d1390f27 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 758dd0f3..76d0efd9 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 9de8625f..3989a84e 100644 --- a/tests/restart_syscall.c +++ b/tests/restart_syscall.c @@ -64,8 +64,15 @@ main(void) (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 ab00da84..be277a43 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 9a30eff2..4b060ced 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 62e7c0de..a32ef366 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 0f25e017..c41444fa 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 01fe2ebb..77d69805 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 dbd53372..51a26759 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 df96e4b3..5c6b6d09 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 b5f19b56..1c034ff3 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 1b6cd0c6..5db30180 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 a84f65e9..ab21fc2c 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 8cf636a8..bc8dcbde 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 458d58bd..1cc6302c 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 4ca0ec7a..01880025 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 7a9d353d..975ba095 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 f0e7086b..ffe8aae2 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 @@ main (void) * 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 @@ main (void) 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 35c647d7..0e76aa73 100644 --- a/tests/truncate.c +++ b/tests/truncate.c @@ -55,7 +55,7 @@ main(void) 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 82565802..a617c69f 100644 --- a/tests/truncate64.c +++ b/tests/truncate64.c @@ -48,7 +48,7 @@ main(void) 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 b79aa79f..a56c5be8 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 bf4d8d22..3a502ba2 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 c0ef120a..41729e8a 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 472461f1..878a48c1 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 fc5eae3d..4a34a7ba 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 380417d2..612767fd 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 141e3838..bb415960 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 9ad6b94d..dac2eadb 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 c7bd42f9..5a78fdcb 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 535f8e7e..c0623c19 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 4f34f51a..4ed60e4b 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 27cb76a0..262bf2e2 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 3205c748..84ee89d8 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 2dcf31cb..6f030dd7 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 c1af785b..89c5b8ab 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 00b9636e..26de9ebb 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 00000000..6a7cce49 --- /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 00000000..ff4422b2 --- /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 6f27d9c7..a1fc0a85 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 073fd514..e7616f3a 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 fbe903a3..de598c80 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 916204e9..fe33873d 100644 --- a/tests/xselect.c +++ b/tests/xselect.c @@ -80,8 +80,8 @@ int main(void) 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 471f22ea..7840190a 100644 --- a/tests/xstatx.c +++ b/tests/xstatx.c @@ -163,7 +163,7 @@ print_stat(const STRUCT_STAT *st) 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 @@ print_stat(const STRUCT_STAT *st) (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 @@ main(void) 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" @@ -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 @@ SYS_FUNC(times) 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); } @@ -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) @@ -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 7f8e3e46..15f825a0 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> @@ -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) @@ -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> @@ -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 0f1adadc..6fbade9b 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 00000000..a8715e2f --- /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 index 6832c65d..6832c65d 100644 --- a/xlat/personality_options.in +++ b/xlat/personality_types.in @@ -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) |